/* scaffold-ai-chat: core.css + the 39 components its markup uses (alert, alert-dialog, audio, avatar, badge, bubble, button, card, chat-components, checkbox, combobox, dialog, dropdown, file-input, icon, input, label, language-switcher, marker, message, mockup-code, number-input, questionnaire, radio, rating, select, separator, session, sidebar, slider, spinner, swap, switch, table, textarea, toast, toggle, typography, video) - generated by scripts/bundle.ts */
/* ── theme/utils/default-semantic-tokens.css ── */
/**
 * defuss-shadcn - Token Layer
 * Semantic CSS custom properties matching the tweakcn.com export format.
 * OKLCH color space. Full surface/foreground pair model.
 *
 * Export a theme from tweakcn.com, replace the :root and .dark blocks,
 * and every component rethemes instantly.
 */

:root {
  color-scheme: light;

  /* -- Surface / Foreground pairs ------------------------------ */
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);

  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);

  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);

  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);

  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);

  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);

  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(1 0 0);

  /* -- Utility tokens ------------------------------------------- */
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);

  /* -- Sidebar tokens ------------------------------------------- */
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  /* 0.97 was within 1.1 contrast of --sidebar - the active nav pill read as
     "no background at all"; 0.94 keeps 12+ text contrast and separates */
  --sidebar-accent: oklch(0.94 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);

  /* -- Chart tokens --------------------------------------------- */
  --chart-1: oklch(0.81 0.1 252);
  --chart-2: oklch(0.62 0.19 260);
  --chart-3: oklch(0.55 0.22 263);
  --chart-4: oklch(0.49 0.22 264);
  --chart-5: oklch(0.42 0.18 266);

  /* -- Typography tokens ---------------------------------------- */
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* -- Radius --------------------------------------------------- */
  --radius: 0.625rem;
  /* Derived - matches tweakcn/shadcn scale */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  /* -- Spacing -------------------------------------------------- */
  --spacing: 0.25rem;

  /* -- Tracking ------------------------------------------------- */
  --tracking-normal: 0em;

  /* -- Links ---------------------------------------------------- */
  /* not part of the tweakcn export: a tweakcn theme leaves them unset and
     .link falls back to these same values */
  --link-text-decoration: underline;
  --link-underline-offset: 4px;

  /* -- Shadow scale --------------------------------------------- */
  --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
  --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
  --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
  --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
  --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
  --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
  --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
}

/* -- Dark mode -------------------------------------------------- */
.dark {
  color-scheme: dark;

  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);

  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);

  --popover: oklch(0.269 0 0);
  --popover-foreground: oklch(0.985 0 0);

  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);

  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);

  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);

  --accent: oklch(0.371 0 0);
  --accent-foreground: oklch(0.985 0 0);

  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.985 0 0);

  --border: oklch(0.275 0 0);
  --input: oklch(0.325 0 0);
  --ring: oklch(0.556 0 0);

  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.275 0 0);
  --sidebar-ring: oklch(0.439 0 0);

  --chart-1: oklch(0.81 0.1 252);
  --chart-2: oklch(0.62 0.19 260);
  --chart-3: oklch(0.55 0.22 263);
  --chart-4: oklch(0.49 0.22 264);
  --chart-5: oklch(0.42 0.18 266);
}

/* ── theme/utils/sizing.css ── */
/* defuss-shadcn - optional sizing utilities.
 * Standalone native CSS. No Tailwind, scan, runtime or consumer build.
 * Numeric dimensions = n × --size-base. Spacing additionally uses density.
 * Theme export remains untouched. Place this sheet before component CSS.
 * Unlayered application rules override normal library rules.
 */
@layer components, utilities;

@layer components {
  :where(:root) {
    --size-base: var(--spacing, 0.25rem);
    --layout-density: 1;
  }

  /* Custom-property formulas resolve before inheritance. Recompute aliases
     at an explicit boundary after overriding --size-base on that boundary. */
  :where(:root, [data-size-scope]) {
    --size-xs: calc(var(--size-base) * 2);
    --size-sm: calc(var(--size-base) * 3);
    --size-md: calc(var(--size-base) * 4);
    --size-lg: calc(var(--size-base) * 6);
    --size-xl: calc(var(--size-base) * 8);
  }

  :where([data-density="compact"]) {
    --layout-density: 0.75;
  }
  :where([data-density="comfortable"]) {
    --layout-density: 1;
  }
  :where([data-density="spacious"]) {
    --layout-density: 1.25;
  }
}

@layer utilities {
  /* These helpers do not change box-sizing: native CSS sizing semantics. */
  :where(.w-0) {
    width: 0px;
  }
  :where(.h-0) {
    height: 0px;
  }
  :where(.size-0) {
    width: 0px;
    height: 0px;
  }
  :where(.min-w-0) {
    min-width: 0px;
  }
  :where(.min-h-0) {
    min-height: 0px;
  }
  :where(.max-w-0) {
    max-width: 0px;
  }
  :where(.max-h-0) {
    max-height: 0px;
  }
  :where(.inline-0) {
    inline-size: 0px;
  }
  :where(.block-0) {
    block-size: 0px;
  }
  :where(.w-0\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.h-0\.5) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.size-0\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.min-w-0\.5) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.min-h-0\.5) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.max-w-0\.5) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.max-h-0\.5) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.inline-0\.5) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.block-0\.5) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5);
  }
  :where(.w-1) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.h-1) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.size-1) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.min-w-1) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.min-h-1) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.max-w-1) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.max-h-1) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.inline-1) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.block-1) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 1);
  }
  :where(.w-1\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.h-1\.5) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.size-1\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.min-w-1\.5) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.min-h-1\.5) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.max-w-1\.5) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.max-h-1\.5) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.inline-1\.5) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.block-1\.5) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5);
  }
  :where(.w-2) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.h-2) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.size-2) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.min-w-2) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.min-h-2) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.max-w-2) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.max-h-2) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.inline-2) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.block-2) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 2);
  }
  :where(.w-2\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.h-2\.5) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.size-2\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.min-w-2\.5) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.min-h-2\.5) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.max-w-2\.5) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.max-h-2\.5) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.inline-2\.5) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.block-2\.5) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5);
  }
  :where(.w-3) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.h-3) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.size-3) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.min-w-3) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.min-h-3) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.max-w-3) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.max-h-3) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.inline-3) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.block-3) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 3);
  }
  :where(.w-3\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.h-3\.5) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.size-3\.5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.min-w-3\.5) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.min-h-3\.5) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.max-w-3\.5) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.max-h-3\.5) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.inline-3\.5) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.block-3\.5) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5);
  }
  :where(.w-4) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.h-4) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.size-4) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.min-w-4) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.min-h-4) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.max-w-4) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.max-h-4) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.inline-4) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.block-4) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 4);
  }
  :where(.w-5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.h-5) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.size-5) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.min-w-5) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.min-h-5) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.max-w-5) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.max-h-5) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.inline-5) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.block-5) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 5);
  }
  :where(.w-6) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.h-6) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.size-6) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.min-w-6) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.min-h-6) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.max-w-6) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.max-h-6) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.inline-6) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.block-6) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 6);
  }
  :where(.w-7) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.h-7) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.size-7) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.min-w-7) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.min-h-7) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.max-w-7) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.max-h-7) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.inline-7) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.block-7) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 7);
  }
  :where(.w-8) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.h-8) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.size-8) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.min-w-8) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.min-h-8) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.max-w-8) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.max-h-8) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.inline-8) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.block-8) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 8);
  }
  :where(.w-9) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.h-9) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.size-9) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.min-w-9) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.min-h-9) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.max-w-9) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.max-h-9) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.inline-9) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.block-9) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 9);
  }
  :where(.w-10) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.h-10) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.size-10) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.min-w-10) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.min-h-10) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.max-w-10) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.max-h-10) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.inline-10) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.block-10) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 10);
  }
  :where(.w-11) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.h-11) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.size-11) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.min-w-11) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.min-h-11) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.max-w-11) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.max-h-11) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.inline-11) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.block-11) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 11);
  }
  :where(.w-12) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.h-12) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.size-12) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.min-w-12) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.min-h-12) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.max-w-12) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.max-h-12) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.inline-12) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.block-12) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 12);
  }
  :where(.w-14) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.h-14) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.size-14) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.min-w-14) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.min-h-14) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.max-w-14) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.max-h-14) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.inline-14) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.block-14) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 14);
  }
  :where(.w-16) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.h-16) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.size-16) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.min-w-16) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.min-h-16) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.max-w-16) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.max-h-16) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.inline-16) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.block-16) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 16);
  }
  :where(.w-20) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.h-20) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.size-20) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.min-w-20) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.min-h-20) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.max-w-20) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.max-h-20) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.inline-20) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.block-20) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 20);
  }
  :where(.w-24) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.h-24) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.size-24) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.min-w-24) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.min-h-24) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.max-w-24) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.max-h-24) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.inline-24) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.block-24) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 24);
  }
  :where(.w-28) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.h-28) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.size-28) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.min-w-28) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.min-h-28) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.max-w-28) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.max-h-28) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.inline-28) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.block-28) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 28);
  }
  :where(.w-32) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.h-32) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.size-32) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.min-w-32) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.min-h-32) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.max-w-32) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.max-h-32) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.inline-32) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.block-32) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 32);
  }
  :where(.w-36) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.h-36) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.size-36) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.min-w-36) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.min-h-36) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.max-w-36) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.max-h-36) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.inline-36) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.block-36) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 36);
  }
  :where(.w-40) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.h-40) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.size-40) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.min-w-40) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.min-h-40) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.max-w-40) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.max-h-40) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.inline-40) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.block-40) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 40);
  }
  :where(.w-48) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.h-48) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.size-48) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.min-w-48) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.min-h-48) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.max-w-48) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.max-h-48) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.inline-48) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.block-48) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 48);
  }
  :where(.w-56) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.h-56) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.size-56) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.min-w-56) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.min-h-56) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.max-w-56) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.max-h-56) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.inline-56) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.block-56) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 56);
  }
  :where(.w-64) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.h-64) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.size-64) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.min-w-64) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.min-h-64) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.max-w-64) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.max-h-64) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.inline-64) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.block-64) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 64);
  }
  :where(.w-72) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.h-72) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.size-72) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.min-w-72) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.min-h-72) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.max-w-72) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.max-h-72) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.inline-72) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.block-72) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 72);
  }
  :where(.w-80) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.h-80) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.size-80) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.min-w-80) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.min-h-80) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.max-w-80) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.max-h-80) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.inline-80) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.block-80) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 80);
  }
  :where(.w-96) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.h-96) {
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.size-96) {
    width: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
    height: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.min-w-96) {
    min-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.min-h-96) {
    min-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.max-w-96) {
    max-width: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.max-h-96) {
    max-height: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.inline-96) {
    inline-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.block-96) {
    block-size: calc(var(--size-base, var(--spacing, 0.25rem)) * 96);
  }
  :where(.w-px) {
    width: 1px;
  }
  :where(.h-px) {
    height: 1px;
  }
  :where(.size-px) {
    width: 1px;
    height: 1px;
  }
  :where(.min-w-px) {
    min-width: 1px;
  }
  :where(.min-h-px) {
    min-height: 1px;
  }
  :where(.max-w-px) {
    max-width: 1px;
  }
  :where(.max-h-px) {
    max-height: 1px;
  }
  :where(.inline-px) {
    inline-size: 1px;
  }
  :where(.block-px) {
    block-size: 1px;
  }

  /* Content-, parent- and viewport-relative dimensions. */
  :where(.w-auto) {
    width: auto;
  }
  :where(.w-full) {
    width: 100%;
  }
  :where(.w-min) {
    width: min-content;
  }
  :where(.w-max) {
    width: max-content;
  }
  :where(.w-fit) {
    width: fit-content;
  }
  :where(.w-1\/2) {
    width: 50%;
  }
  :where(.w-1\/3) {
    width: calc(100% / 3);
  }
  :where(.w-2\/3) {
    width: calc(200% / 3);
  }
  :where(.w-1\/4) {
    width: 25%;
  }
  :where(.w-3\/4) {
    width: 75%;
  }
  :where(.h-auto) {
    height: auto;
  }
  :where(.h-full) {
    height: 100%;
  }
  :where(.h-min) {
    height: min-content;
  }
  :where(.h-max) {
    height: max-content;
  }
  :where(.h-fit) {
    height: fit-content;
  }
  :where(.h-1\/2) {
    height: 50%;
  }
  :where(.h-1\/3) {
    height: calc(100% / 3);
  }
  :where(.h-2\/3) {
    height: calc(200% / 3);
  }
  :where(.h-1\/4) {
    height: 25%;
  }
  :where(.h-3\/4) {
    height: 75%;
  }
  :where(.inline-auto) {
    inline-size: auto;
  }
  :where(.inline-full) {
    inline-size: 100%;
  }
  :where(.inline-min) {
    inline-size: min-content;
  }
  :where(.inline-max) {
    inline-size: max-content;
  }
  :where(.inline-fit) {
    inline-size: fit-content;
  }
  :where(.inline-1\/2) {
    inline-size: 50%;
  }
  :where(.inline-1\/3) {
    inline-size: calc(100% / 3);
  }
  :where(.inline-2\/3) {
    inline-size: calc(200% / 3);
  }
  :where(.inline-1\/4) {
    inline-size: 25%;
  }
  :where(.inline-3\/4) {
    inline-size: 75%;
  }
  :where(.block-auto) {
    block-size: auto;
  }
  :where(.block-full) {
    block-size: 100%;
  }
  :where(.block-min) {
    block-size: min-content;
  }
  :where(.block-max) {
    block-size: max-content;
  }
  :where(.block-fit) {
    block-size: fit-content;
  }
  :where(.block-1\/2) {
    block-size: 50%;
  }
  :where(.block-1\/3) {
    block-size: calc(100% / 3);
  }
  :where(.block-2\/3) {
    block-size: calc(200% / 3);
  }
  :where(.block-1\/4) {
    block-size: 25%;
  }
  :where(.block-3\/4) {
    block-size: 75%;
  }
  :where(.min-w-full) {
    min-width: 100%;
  }
  :where(.min-w-min) {
    min-width: min-content;
  }
  :where(.min-w-max) {
    min-width: max-content;
  }
  :where(.min-w-fit) {
    min-width: fit-content;
  }
  :where(.min-h-full) {
    min-height: 100%;
  }
  :where(.min-h-min) {
    min-height: min-content;
  }
  :where(.min-h-max) {
    min-height: max-content;
  }
  :where(.min-h-fit) {
    min-height: fit-content;
  }
  :where(.max-w-full) {
    max-width: 100%;
  }
  :where(.max-w-min) {
    max-width: min-content;
  }
  :where(.max-w-max) {
    max-width: max-content;
  }
  :where(.max-w-fit) {
    max-width: fit-content;
  }
  :where(.max-h-full) {
    max-height: 100%;
  }
  :where(.max-h-min) {
    max-height: min-content;
  }
  :where(.max-h-max) {
    max-height: max-content;
  }
  :where(.max-h-fit) {
    max-height: fit-content;
  }
  :where(.max-w-none) {
    max-width: none;
  }
  :where(.max-h-none) {
    max-height: none;
  }
  :where(.h-screen) {
    height: 100vh;
  }
  :where(.min-h-screen) {
    min-height: 100vh;
  }
  :where(.max-h-screen) {
    max-height: 100vh;
  }
  :where(.h-dvh) {
    height: 100dvh;
  }
  :where(.min-h-dvh) {
    min-height: 100dvh;
  }
  :where(.max-h-dvh) {
    max-height: 100dvh;
  }
  :where(.h-svh) {
    height: 100svh;
  }
  :where(.min-h-svh) {
    min-height: 100svh;
  }
  :where(.max-h-svh) {
    max-height: 100svh;
  }
  :where(.h-lvh) {
    height: 100lvh;
  }
  :where(.min-h-lvh) {
    min-height: 100lvh;
  }
  :where(.max-h-lvh) {
    max-height: 100lvh;
  }
  :where(.w-screen) {
    width: 100vw;
  }
  :where(.box-border) {
    box-sizing: border-box;
  }
  :where(.box-content) {
    box-sizing: content-box;
  }

  /* Spacing: compatible names; density is an explicit extension. */
  :where(.gap-0) {
    gap: 0px;
  }
  :where(.gap-x-0) {
    column-gap: 0px;
  }
  :where(.gap-y-0) {
    row-gap: 0px;
  }
  :where(.p-0) {
    padding: 0px;
  }
  :where(.px-0) {
    padding-inline: 0px;
  }
  :where(.py-0) {
    padding-block: 0px;
  }
  :where(.pt-0) {
    padding-top: 0px;
  }
  :where(.pr-0) {
    padding-right: 0px;
  }
  :where(.pb-0) {
    padding-bottom: 0px;
  }
  :where(.pl-0) {
    padding-left: 0px;
  }
  :where(.ps-0) {
    padding-inline-start: 0px;
  }
  :where(.pe-0) {
    padding-inline-end: 0px;
  }
  :where(.m-0) {
    margin: 0px;
  }
  :where(.mx-0) {
    margin-inline: 0px;
  }
  :where(.my-0) {
    margin-block: 0px;
  }
  :where(.mt-0) {
    margin-top: 0px;
  }
  :where(.mr-0) {
    margin-right: 0px;
  }
  :where(.mb-0) {
    margin-bottom: 0px;
  }
  :where(.ml-0) {
    margin-left: 0px;
  }
  :where(.ms-0) {
    margin-inline-start: 0px;
  }
  :where(.me-0) {
    margin-inline-end: 0px;
  }
  :where(.gap-0\.5) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-0\.5) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-0\.5) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.p-0\.5) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.px-0\.5) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.py-0\.5) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-0\.5) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-0\.5) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-0\.5) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-0\.5) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-0\.5) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-0\.5) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.m-0\.5) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-0\.5) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.my-0\.5) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-0\.5) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-0\.5) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-0\.5) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-0\.5) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-0\.5) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.me-0\.5) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 0.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-1) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-1) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-1) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.p-1) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.px-1) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.py-1) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-1) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-1) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-1) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-1) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-1) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-1) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.m-1) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-1) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.my-1) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-1) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-1) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-1) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-1) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-1) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.me-1) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 1 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-1\.5) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-1\.5) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-1\.5) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.p-1\.5) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.px-1\.5) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.py-1\.5) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-1\.5) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-1\.5) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-1\.5) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-1\.5) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-1\.5) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-1\.5) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.m-1\.5) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-1\.5) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.my-1\.5) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-1\.5) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-1\.5) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-1\.5) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-1\.5) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-1\.5) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.me-1\.5) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 1.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-2) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-2) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-2) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.p-2) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.px-2) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.py-2) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-2) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-2) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-2) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-2) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-2) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-2) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.m-2) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-2) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.my-2) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-2) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-2) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-2) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-2) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-2) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.me-2) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 2 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-2\.5) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-2\.5) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-2\.5) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.p-2\.5) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.px-2\.5) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.py-2\.5) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-2\.5) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-2\.5) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-2\.5) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-2\.5) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-2\.5) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-2\.5) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.m-2\.5) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-2\.5) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.my-2\.5) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-2\.5) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-2\.5) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-2\.5) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-2\.5) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-2\.5) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.me-2\.5) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 2.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-3) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-3) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-3) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.p-3) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.px-3) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.py-3) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-3) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-3) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-3) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-3) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-3) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-3) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.m-3) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-3) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.my-3) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-3) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-3) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-3) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-3) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-3) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.me-3) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 3 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-3\.5) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-3\.5) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-3\.5) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.p-3\.5) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.px-3\.5) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.py-3\.5) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-3\.5) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-3\.5) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-3\.5) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-3\.5) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-3\.5) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-3\.5) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.m-3\.5) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-3\.5) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.my-3\.5) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-3\.5) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-3\.5) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-3\.5) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-3\.5) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-3\.5) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.me-3\.5) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 3.5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-4) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-4) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-4) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.p-4) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.px-4) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.py-4) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-4) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-4) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-4) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-4) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-4) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-4) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.m-4) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-4) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.my-4) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-4) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-4) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-4) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-4) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-4) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.me-4) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-5) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-5) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-5) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.p-5) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.px-5) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.py-5) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-5) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-5) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-5) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-5) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-5) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-5) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.m-5) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-5) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.my-5) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-5) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-5) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-5) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-5) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-5) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.me-5) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 5 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-6) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-6) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-6) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.p-6) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.px-6) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.py-6) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-6) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-6) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-6) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-6) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-6) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-6) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.m-6) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-6) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.my-6) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-6) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-6) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-6) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-6) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-6) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.me-6) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 6 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-7) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-7) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-7) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.p-7) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.px-7) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.py-7) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-7) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-7) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-7) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-7) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-7) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-7) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.m-7) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-7) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.my-7) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-7) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-7) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-7) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-7) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-7) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.me-7) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 7 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-8) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-8) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-8) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.p-8) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.px-8) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.py-8) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-8) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-8) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-8) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-8) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-8) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-8) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.m-8) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-8) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.my-8) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-8) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-8) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-8) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-8) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-8) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.me-8) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 8 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-9) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-9) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-9) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.p-9) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.px-9) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.py-9) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-9) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-9) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-9) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-9) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-9) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-9) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.m-9) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-9) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.my-9) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-9) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-9) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-9) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-9) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-9) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.me-9) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 9 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-10) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-10) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-10) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.p-10) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.px-10) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.py-10) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-10) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-10) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-10) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-10) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-10) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-10) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.m-10) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-10) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.my-10) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-10) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-10) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-10) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-10) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-10) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.me-10) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 10 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-11) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-11) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-11) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.p-11) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.px-11) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.py-11) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-11) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-11) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-11) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-11) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-11) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-11) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.m-11) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-11) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.my-11) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-11) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-11) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-11) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-11) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-11) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.me-11) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 11 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-12) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-12) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-12) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.p-12) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.px-12) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.py-12) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-12) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-12) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-12) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-12) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-12) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-12) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.m-12) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-12) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.my-12) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-12) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-12) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-12) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-12) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-12) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.me-12) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 12 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-14) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-14) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-14) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.p-14) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.px-14) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.py-14) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-14) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-14) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-14) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-14) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-14) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-14) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.m-14) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-14) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.my-14) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-14) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-14) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-14) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-14) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-14) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.me-14) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 14 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-16) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-16) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-16) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.p-16) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.px-16) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.py-16) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-16) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-16) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-16) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-16) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-16) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-16) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.m-16) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-16) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.my-16) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-16) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-16) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-16) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-16) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-16) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.me-16) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 16 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-20) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-20) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-20) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.p-20) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.px-20) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.py-20) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-20) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-20) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-20) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-20) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-20) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-20) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.m-20) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-20) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.my-20) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-20) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-20) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-20) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-20) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-20) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.me-20) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 20 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-24) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-24) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-24) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.p-24) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.px-24) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.py-24) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-24) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-24) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-24) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-24) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-24) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-24) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.m-24) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-24) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.my-24) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-24) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-24) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-24) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-24) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-24) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.me-24) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 24 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-28) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-28) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-28) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.p-28) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.px-28) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.py-28) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-28) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-28) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-28) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-28) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-28) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-28) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.m-28) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-28) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.my-28) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-28) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-28) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-28) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-28) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-28) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.me-28) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 28 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-32) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-32) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-32) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.p-32) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.px-32) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.py-32) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-32) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-32) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-32) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-32) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-32) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-32) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.m-32) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-32) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.my-32) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-32) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-32) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-32) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-32) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-32) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.me-32) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 32 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-36) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-36) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-36) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.p-36) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.px-36) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.py-36) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-36) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-36) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-36) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-36) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-36) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-36) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.m-36) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-36) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.my-36) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-36) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-36) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-36) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-36) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-36) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.me-36) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 36 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-40) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-40) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-40) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.p-40) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.px-40) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.py-40) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-40) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-40) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-40) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-40) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-40) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-40) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.m-40) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-40) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.my-40) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-40) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-40) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-40) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-40) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-40) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.me-40) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 40 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-48) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-48) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-48) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.p-48) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.px-48) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.py-48) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-48) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-48) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-48) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-48) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-48) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-48) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.m-48) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-48) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.my-48) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-48) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-48) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-48) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-48) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-48) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.me-48) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 48 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-56) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-56) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-56) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.p-56) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.px-56) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.py-56) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-56) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-56) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-56) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-56) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-56) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-56) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.m-56) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-56) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.my-56) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-56) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-56) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-56) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-56) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-56) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.me-56) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 56 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-64) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-64) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-64) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.p-64) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.px-64) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.py-64) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-64) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-64) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-64) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-64) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-64) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-64) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.m-64) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-64) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.my-64) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-64) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-64) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-64) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-64) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-64) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.me-64) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 64 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-72) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-72) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-72) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.p-72) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.px-72) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.py-72) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-72) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-72) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-72) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-72) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-72) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-72) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.m-72) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-72) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.my-72) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-72) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-72) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-72) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-72) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-72) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.me-72) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 72 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-80) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-80) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-80) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.p-80) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.px-80) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.py-80) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-80) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-80) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-80) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-80) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-80) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-80) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.m-80) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-80) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.my-80) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-80) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-80) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-80) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-80) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-80) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.me-80) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 80 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-96) {
    gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-x-96) {
    column-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-y-96) {
    row-gap: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.p-96) {
    padding: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.px-96) {
    padding-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.py-96) {
    padding-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.pt-96) {
    padding-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.pr-96) {
    padding-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.pb-96) {
    padding-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.pl-96) {
    padding-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.ps-96) {
    padding-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.pe-96) {
    padding-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.m-96) {
    margin: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.mx-96) {
    margin-inline: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.my-96) {
    margin-block: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.mt-96) {
    margin-top: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.mr-96) {
    margin-right: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.mb-96) {
    margin-bottom: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.ml-96) {
    margin-left: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.ms-96) {
    margin-inline-start: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.me-96) {
    margin-inline-end: calc(var(--size-base, var(--spacing, 0.25rem)) * 96 * max(0, var(--layout-density, 1)));
  }
  :where(.gap-px) {
    gap: 1px;
  }
  :where(.gap-x-px) {
    column-gap: 1px;
  }
  :where(.gap-y-px) {
    row-gap: 1px;
  }
  :where(.p-px) {
    padding: 1px;
  }
  :where(.px-px) {
    padding-inline: 1px;
  }
  :where(.py-px) {
    padding-block: 1px;
  }
  :where(.pt-px) {
    padding-top: 1px;
  }
  :where(.pr-px) {
    padding-right: 1px;
  }
  :where(.pb-px) {
    padding-bottom: 1px;
  }
  :where(.pl-px) {
    padding-left: 1px;
  }
  :where(.ps-px) {
    padding-inline-start: 1px;
  }
  :where(.pe-px) {
    padding-inline-end: 1px;
  }
  :where(.m-px) {
    margin: 1px;
  }
  :where(.mx-px) {
    margin-inline: 1px;
  }
  :where(.my-px) {
    margin-block: 1px;
  }
  :where(.mt-px) {
    margin-top: 1px;
  }
  :where(.mr-px) {
    margin-right: 1px;
  }
  :where(.mb-px) {
    margin-bottom: 1px;
  }
  :where(.ml-px) {
    margin-left: 1px;
  }
  :where(.ms-px) {
    margin-inline-start: 1px;
  }
  :where(.me-px) {
    margin-inline-end: 1px;
  }
  :where(.m-auto) {
    margin: auto;
  }
  :where(.mx-auto) {
    margin-inline: auto;
  }
  :where(.my-auto) {
    margin-block: auto;
  }
  :where(.mt-auto) {
    margin-top: auto;
  }
  :where(.mr-auto) {
    margin-right: auto;
  }
  :where(.mb-auto) {
    margin-bottom: auto;
  }
  :where(.ml-auto) {
    margin-left: auto;
  }
  :where(.ms-auto) {
    margin-inline-start: auto;
  }
  :where(.me-auto) {
    margin-inline-end: auto;
  }
}

/* ── theme/utils/layout.css ── */
/* defuss-shadcn - optional native layout utilities.
 * .flex / .grid only select a formatting context: no default gap or tracks.
 * .stack / .center / .container / .query and .grid-cols-auto are extensions.
 * Params are instance-owned: nested primitives do not inherit outer configs.
 * Native hidden/closed states are not overridden by display helpers.
 */
@layer components, utilities;

@layer components {
  :where(.flex, .inline-flex, .grid, .inline-grid, .stack, .center) {
    --layout-gap: initial;
  }
  :where(.grid, .inline-grid) {
    --layout-min: 16rem;
  }
  :where(.stack) {
    gap: var(--layout-gap, calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1))));
    flex-direction: column;
  }
  :where(.flex, .inline-flex, .grid, .inline-grid, .center) {
    gap: var(--layout-gap, 0px);
  }
  :where(.container) {
    --layout-max: 80rem;
    --layout-gutter: calc(var(--size-base, var(--spacing, 0.25rem)) * 4 * max(0, var(--layout-density, 1)));
    box-sizing: border-box;
    inline-size: 100%;
    max-inline-size: var(--layout-max);
    min-inline-size: 0;
    margin-inline: auto;
    padding-inline: var(--layout-gutter);
  }
  :where(.center) {
    place-items: center;
  }
  :where(.query) {
    container: layout / inline-size;
  }
}

@layer utilities {
  :where(
    .flex:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open)),
    .stack:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))
  ) {
    display: flex;
  }
  :where(.inline-flex:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))) {
    display: inline-flex;
  }
  :where(
    .grid:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open)),
    .center:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))
  ) {
    display: grid;
  }
  :where(.inline-grid:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))) {
    display: inline-grid;
  }
  :where(.block:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))) {
    display: block;
  }
  :where(.inline-block:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))) {
    display: inline-block;
  }
  :where(.inline:not([hidden]):not(dialog:not([open])):not([popover]:not(:popover-open))) {
    display: inline;
  }
  :where(.hidden) {
    display: none;
  }
  :where(.flex-row) {
    flex-direction: row;
  }
  :where(.flex-col) {
    flex-direction: column;
  }
  :where(.flex-wrap) {
    flex-wrap: wrap;
  }
  :where(.flex-nowrap) {
    flex-wrap: nowrap;
  }
  :where(.flex-1) {
    flex: 1 1 0%;
  }
  :where(.flex-auto) {
    flex: 1 1 auto;
  }
  :where(.flex-initial) {
    flex: 0 1 auto;
  }
  :where(.flex-none) {
    flex: none;
  }
  :where(.grow) {
    flex-grow: 1;
  }
  :where(.grow-0) {
    flex-grow: 0;
  }
  :where(.shrink) {
    flex-shrink: 1;
  }
  :where(.shrink-0) {
    flex-shrink: 0;
  }
  :where(.basis-0) {
    flex-basis: 0px;
  }
  :where(.basis-auto) {
    flex-basis: auto;
  }
  :where(.basis-full) {
    flex-basis: 100%;
  }
  :where(.items-start) {
    align-items: flex-start;
  }
  :where(.items-end) {
    align-items: flex-end;
  }
  :where(.items-center) {
    align-items: center;
  }
  :where(.items-baseline) {
    align-items: baseline;
  }
  :where(.items-stretch) {
    align-items: stretch;
  }
  :where(.justify-start) {
    justify-content: flex-start;
  }
  :where(.justify-end) {
    justify-content: flex-end;
  }
  :where(.justify-center) {
    justify-content: center;
  }
  :where(.justify-between) {
    justify-content: space-between;
  }
  :where(.justify-around) {
    justify-content: space-around;
  }
  :where(.justify-evenly) {
    justify-content: space-evenly;
  }
  :where(.justify-normal) {
    justify-content: normal;
  }
  :where(.self-auto) {
    align-self: auto;
  }
  :where(.self-start) {
    align-self: flex-start;
  }
  :where(.self-end) {
    align-self: flex-end;
  }
  :where(.self-center) {
    align-self: center;
  }
  :where(.self-baseline) {
    align-self: baseline;
  }
  :where(.self-stretch) {
    align-self: stretch;
  }
  :where(.content-start) {
    align-content: flex-start;
  }
  :where(.content-end) {
    align-content: flex-end;
  }
  :where(.content-center) {
    align-content: center;
  }
  :where(.content-between) {
    align-content: space-between;
  }
  :where(.content-around) {
    align-content: space-around;
  }
  :where(.content-evenly) {
    align-content: space-evenly;
  }
  :where(.content-stretch) {
    align-content: stretch;
  }
  :where(.content-normal) {
    align-content: normal;
  }
  :where(.justify-items-start) {
    justify-items: start;
  }
  :where(.justify-items-end) {
    justify-items: end;
  }
  :where(.justify-items-center) {
    justify-items: center;
  }
  :where(.justify-items-stretch) {
    justify-items: stretch;
  }
  :where(.justify-self-auto) {
    justify-self: auto;
  }
  :where(.justify-self-start) {
    justify-self: start;
  }
  :where(.justify-self-end) {
    justify-self: end;
  }
  :where(.justify-self-center) {
    justify-self: center;
  }
  :where(.justify-self-stretch) {
    justify-self: stretch;
  }
  :where(.place-items-start) {
    place-items: start;
  }
  :where(.place-items-end) {
    place-items: end;
  }
  :where(.place-items-center) {
    place-items: center;
  }
  :where(.place-items-stretch) {
    place-items: stretch;
  }
  :where(.place-items-baseline) {
    place-items: baseline;
  }
  :where(.place-self-auto) {
    place-self: auto;
  }
  :where(.place-self-start) {
    place-self: start;
  }
  :where(.place-self-end) {
    place-self: end;
  }
  :where(.place-self-center) {
    place-self: center;
  }
  :where(.place-self-stretch) {
    place-self: stretch;
  }

  /* Intrinsic and explicit tracks; no implicit breakpoint generator. */
  :where(.grid-cols-auto) {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--layout-min, 16rem)), 1fr));
  }
  :where(.grid-cols-1) {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  :where(.col-span-1) {
    grid-column: span 1 / span 1;
  }
  :where(.grid-cols-2) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where(.col-span-2) {
    grid-column: span 2 / span 2;
  }
  :where(.grid-cols-3) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  :where(.col-span-3) {
    grid-column: span 3 / span 3;
  }
  :where(.grid-cols-4) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  :where(.col-span-4) {
    grid-column: span 4 / span 4;
  }
  :where(.grid-cols-5) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  :where(.col-span-5) {
    grid-column: span 5 / span 5;
  }
  :where(.grid-cols-6) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  :where(.col-span-6) {
    grid-column: span 6 / span 6;
  }
  :where(.grid-cols-7) {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  :where(.col-span-7) {
    grid-column: span 7 / span 7;
  }
  :where(.grid-cols-8) {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  :where(.col-span-8) {
    grid-column: span 8 / span 8;
  }
  :where(.grid-cols-9) {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }
  :where(.col-span-9) {
    grid-column: span 9 / span 9;
  }
  :where(.grid-cols-10) {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
  :where(.col-span-10) {
    grid-column: span 10 / span 10;
  }
  :where(.grid-cols-11) {
    grid-template-columns: repeat(11, minmax(0, 1fr));
  }
  :where(.col-span-11) {
    grid-column: span 11 / span 11;
  }
  :where(.grid-cols-12) {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  :where(.col-span-12) {
    grid-column: span 12 / span 12;
  }
  :where(.grid-rows-1) {
    grid-template-rows: repeat(1, minmax(0, 1fr));
  }
  :where(.row-span-1) {
    grid-row: span 1 / span 1;
  }
  :where(.grid-rows-2) {
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  :where(.row-span-2) {
    grid-row: span 2 / span 2;
  }
  :where(.grid-rows-3) {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
  :where(.row-span-3) {
    grid-row: span 3 / span 3;
  }
  :where(.grid-rows-4) {
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }
  :where(.row-span-4) {
    grid-row: span 4 / span 4;
  }
  :where(.grid-rows-5) {
    grid-template-rows: repeat(5, minmax(0, 1fr));
  }
  :where(.row-span-5) {
    grid-row: span 5 / span 5;
  }
  :where(.grid-rows-6) {
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }
  :where(.row-span-6) {
    grid-row: span 6 / span 6;
  }
  :where(.col-span-full) {
    grid-column: 1 / -1;
  }
  :where(.row-span-full) {
    grid-row: 1 / -1;
  }
  :where(.grid-cols-none) {
    grid-template-columns: none;
  }
  :where(.grid-rows-none) {
    grid-template-rows: none;
  }
  :where(.grid-cols-subgrid) {
    grid-template-columns: subgrid;
  }
  :where(.grid-rows-subgrid) {
    grid-template-rows: subgrid;
  }
  :where(.auto-rows-auto) {
    grid-auto-rows: auto;
  }
  :where(.auto-cols-auto) {
    grid-auto-columns: auto;
  }

  /* Box clipping/scrolling and text-flow control - orthogonal to gap/track
     selection; the generic pairing for constrained containers (a scrollable
     table on a capped width needs both overflow-x-auto and nowrap cells). */
  :where(.overflow-x-auto) {
    overflow-x: auto;
  }
  :where(.overflow-y-auto) {
    overflow-y: auto;
  }
  :where(.overflow-auto) {
    overflow: auto;
  }
  :where(.overflow-hidden) {
    overflow: hidden;
  }
  :where(.overflow-visible) {
    overflow: visible;
  }
  :where(.overflow-clip) {
    overflow: clip;
  }
  :where(.overflow-x-hidden) {
    overflow-x: hidden;
  }
  :where(.overflow-y-hidden) {
    overflow-y: hidden;
  }
  /* Text-overflow applies to the block axis of an overflowing line box —
     pair with overflow-hidden (truncate bundles all three parts). */
  :where(.text-ellipsis) {
    text-overflow: ellipsis;
  }
  :where(.text-clip) {
    text-overflow: clip;
  }
  :where(.truncate) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Overflowing WORDS: break-word/anywhere split on demand, break-all splits
     per character, break-normal restores. `wrap-anywhere` also shrinks
     min-content - the flex min-w-0 companion that lets a long identifier wrap
     inside a shrinkable track. */
  :where(.break-normal) {
    overflow-wrap: normal;
    word-break: normal;
  }
  :where(.break-words) {
    overflow-wrap: break-word;
  }
  :where(.break-all) {
    word-break: break-all;
  }
  :where(.wrap-anywhere) {
    overflow-wrap: anywhere;
  }
  :where(.whitespace-nowrap) {
    white-space: nowrap;
  }
  :where(.whitespace-normal) {
    white-space: normal;
  }
  :where(.whitespace-pre-wrap) {
    white-space: pre-wrap;
  }
}

/* ── theme/utils/accessibility.css ── */
/* defuss-shadcn - optional accessibility utilities.
 * Text meant for assistive technology only (.sr-only) and its inverse
 * (.not-sr-only). The clip pattern keeps content in the AT tree while
 * removing it visually - display:none would hide it from screen readers too.
 * Focusable elements re-reveal via :focus / :focus-within so keyboard users
 * never lose the control entirely (the Tailwind idiom, kept intact).
 */
@layer components, utilities;

@layer utilities {
  :where(.sr-only) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border-width: 0;
  }

  /* Undo .sr-only back to ordinary flow content. */
  :where(.not-sr-only) {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }
}

/* ── components/alert/alert.css ── */
@layer components {
  .alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--foreground);
    background-color: var(--background);

    &[data-variant="destructive"] {
      border-color: var(--destructive);
      color: var(--destructive);

      & .alert-title {
        color: var(--destructive);
      }

      & .alert-description {
        color: var(--destructive);
        opacity: 0.9;
      }

      & .alert-icon {
        color: var(--destructive);
      }
    }
  }

  .alert-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--foreground);
  }

  .alert-content {
    flex: 1;
    min-width: 0;
  }

  /* -- Density --------------------------------------------------
     data-density on the .alert root scales its padding and the icon/content
     gap (ratio 0.75 / 1 / 1.25); comfortable matches the unsized default. */
  .alert:where([data-density="compact"]) {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .alert:where([data-density="comfortable"]) {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }
  .alert:where([data-density="spacious"]) {
    padding: 1.25rem 1.5rem;
    gap: 1rem;
  }

  .alert-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--foreground);
  }

  .alert-description {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--muted-foreground);
  }

  .alert-action {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
  }
}

/* ── components/alert-dialog/alert-dialog.css ── */
@layer components {
  dialog.alert-dialog {
    border: none;
    border-radius: var(--radius-xl);
    background: var(--background);
    color: var(--foreground);
    padding: 0;
    max-width: 28rem;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow-lg);
    margin: auto;
    position: fixed;
    inset: 0;

    /* Entry/exit animation */
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.98);
    transition:
      opacity 200ms ease,
      transform 200ms ease,
      display 200ms allow-discrete;

    &[open] {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    &::backdrop {
      background: oklch(0 0 0 / 0);
      backdrop-filter: blur(0px);
      transition:
        all 200ms ease,
        display 200ms allow-discrete;
    }

    &[open]::backdrop {
      background: oklch(0 0 0 / 0.45);
      backdrop-filter: blur(3px);
    }

    /* Block Escape key - user must choose an action */
    &::backdrop {
      pointer-events: auto;
    }
  }

  @starting-style {
    dialog.alert-dialog[open] {
      opacity: 0;
      transform: translateY(-0.5rem) scale(0.98);
    }
    dialog.alert-dialog[open]::backdrop {
      background: oklch(0 0 0 / 0);
      backdrop-filter: blur(0px);
    }
  }

  /* -- Scroll lock ------------------------------------------- */
  /* Page behind stays put while the alert is modal (see dialog.css):
     `:modal` + overflow:hidden freezes the viewport at its current offset. */
  html:has(dialog.alert-dialog:modal) {
    overflow: hidden;
    scrollbar-gutter: stable;
  }

  .alert-dialog-content {
    padding: 1.5rem;
  }

  /* -- Density ------------------------------------------------
     data-density on the .alert-dialog root scales the content padding
     (0.75 / 1 / 1.25 of the 1.5rem default); comfortable matches the
     unsized default. */
  .alert-dialog:where([data-density="compact"]) .alert-dialog-content {
    padding: 1rem;
  }
  .alert-dialog:where([data-density="comfortable"]) .alert-dialog-content {
    padding: 1.5rem;
  }
  .alert-dialog:where([data-density="spacious"]) .alert-dialog-content {
    padding: 2rem;
  }

  .alert-dialog-header {
    margin-bottom: 1.25rem;
  }

  .alert-dialog-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
  }

  .alert-dialog-description {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
  }

  .alert-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .alert-dialog,
    .alert-dialog *,
    .alert-dialog::before,
    .alert-dialog::after,
    .alert-dialog *::before,
    .alert-dialog *::after,
    .alert-dialog::backdrop,
    .alert-dialog-content,
    .alert-dialog-content *,
    .alert-dialog-content::before,
    .alert-dialog-content::after,
    .alert-dialog-content *::before,
    .alert-dialog-content *::after,
    .alert-dialog-content::backdrop,
    .alert-dialog-header,
    .alert-dialog-header *,
    .alert-dialog-header::before,
    .alert-dialog-header::after,
    .alert-dialog-header *::before,
    .alert-dialog-header *::after,
    .alert-dialog-header::backdrop,
    .alert-dialog-title,
    .alert-dialog-title *,
    .alert-dialog-title::before,
    .alert-dialog-title::after,
    .alert-dialog-title *::before,
    .alert-dialog-title *::after,
    .alert-dialog-title::backdrop,
    .alert-dialog-description,
    .alert-dialog-description *,
    .alert-dialog-description::before,
    .alert-dialog-description::after,
    .alert-dialog-description *::before,
    .alert-dialog-description *::after,
    .alert-dialog-description::backdrop,
    .alert-dialog-footer,
    .alert-dialog-footer *,
    .alert-dialog-footer::before,
    .alert-dialog-footer::after,
    .alert-dialog-footer *::before,
    .alert-dialog-footer *::after,
    .alert-dialog-footer::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/audio/audio.css ── */
/* -- Audio component ------------------------------------------ */
/* A native <audio> (no controls of its own) behind one row: the  */
/* play toggle, a title over the scrubber and its readouts, the   */
/* sound controls - Buttons, Sliders and readouts                 */
/* (data-audio-action / -output). An optional line under the      */
/* scrubber shows the active caption cue, a transcript as it is   */
/* spoken. data-variant="compact" drops the frame and the title.  */
@layer components {
  .audio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    inline-size: 100%;
    min-inline-size: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--card);
    color: var(--card-foreground);
    container-type: inline-size;

    & > audio:not([controls]) {
      display: none;
    }

    & > [data-audio-action="volume"] {
      inline-size: 4.5rem;
    }
  }

  .audio-body {
    display: grid;
    flex: 1;
    gap: 0.125rem;
    min-inline-size: 0;
  }

  .audio-title {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .audio-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-inline-size: 0;

    & > [data-audio-action="seek"] {
      flex: 1;
      min-inline-size: 3rem;
    }
  }

  /* a readout: m:ss in even digits, so the row does not jitter */
  .audio-time {
    min-inline-size: 2.5rem;
    color: var(--muted-foreground);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  /* the active cue - collapses when captions are off or nothing is said */
  .audio-captions {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-style: italic;
    text-wrap: pretty;

    &:empty {
      display: none;
    }
  }

  /* a toggle with two icons shows the first when off, the second when on (play / pause, sound / muted) */
  [data-audio-action][aria-pressed="false"] > :nth-child(2),
  [data-audio-action][aria-pressed="true"] > :nth-child(1):not(:only-child) {
    display: none;
  }

  /* a control the page may not use (full screen in a frame without it) - over the Button's own display */
  [data-audio-action][hidden] {
    display: none;
  }

  /* a rate select keeps its own width in the row (a Select is as wide as its box) */
  select[data-audio-action="rate"] {
    flex: none;
    inline-size: auto;
  }

  /* the sound button with a vertical volume in a panel above it (below with data-side="bottom"), shown while the
     pointer or the focus is on either - the row keeps one button's width */
  .audio-volume {
    position: relative;
    display: inline-flex;
  }

  .audio-volume-panel {
    position: absolute;
    inset-block-end: 100%;
    inset-inline-start: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    margin-block-end: 0.375rem;
    padding: 0.75rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--popover);
    box-shadow: var(--shadow-md);
    translate: -50% 0;
    visibility: hidden;
    opacity: 0;

    /* the gap to the button belongs to the hover */
    &::after {
      position: absolute;
      inset-inline: 0;
      inset-block-start: 100%;
      block-size: 0.5rem;
      content: "";
    }

    /* a vertical range's block axis is horizontal: its length is its height */
    & > .slider[data-orientation="vertical"] {
      height: 5.5rem;
    }

    .audio-volume:is(:hover, :focus-within) > & {
      visibility: visible;
      opacity: 1;
    }

    .audio-volume[data-side="bottom"] > & {
      inset-block: 100% auto;
      margin-block: 0.375rem 0;

      &::after {
        inset-block: auto 100%;
      }
    }
  }

  .audio[data-variant="compact"] {
    padding: 0;
    border: 0;
    background-color: transparent;

    & .audio-title {
      display: none;
    }
  }

  /* a narrow player keeps play, the scrubber, the time and the sound */
  @container (inline-size < 22rem) {
    .audio > [data-audio-action="volume"],
    .audio > [data-audio-action="rate"],
    .audio-progress > [data-audio-output="duration"] {
      display: none;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .audio-volume-panel {
      transition:
        opacity 0.15s ease,
        visibility 0.15s allow-discrete;
    }
  }

  @media (prefers-contrast: more) {
    .audio-time,
    .audio-captions {
      color: var(--foreground);
    }
  }

  @media (forced-colors: active) {
    .audio,
    .audio-volume-panel {
      border-color: CanvasText;
    }

    .audio-volume-panel {
      background-color: Canvas;
    }
  }
}

/* ── components/avatar/avatar.css ── */
@layer components {
  .avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
    background-color: var(--muted);

    /* No overflow:hidden: the badge dot sits half outside the circle (like
       shadcn's -right-1 dot) and clipping cut it to a sliver. Circular
       rendering comes from border-radius: inherit on image/fallback instead. */

    &[data-size="xs"] {
      width: 1.5rem;
      height: 1.5rem;
      --_badge: 0.75rem;
      font-size: 0.5625rem;
    }

    &[data-size="sm"] {
      width: 2rem;
      height: 2rem;
      --_badge: 1rem;
      font-size: 0.6875rem;
    }

    &[data-size="md"] {
      width: 2.5rem;
      height: 2.5rem;
      --_badge: 1.25rem;
      font-size: 0.75rem;
    }

    &[data-size="lg"] {
      width: 3rem;
      height: 3rem;
      --_badge: 1.5rem;
      font-size: 0.875rem;
    }

    &[data-size="xl"] {
      width: 4rem;
      height: 4rem;
      --_badge: 1.75rem;
      font-size: 1rem;
    }

    /* -- Shape: the image and fallback inherit the radius, so one
       attribute reshapes the whole avatar (the badge is never clipped).
       For silhouettes (heart, squircle, hexagon…) put a shape-* class from
       theme/utils/shapes.css on the .avatar-image instead. */
    &[data-shape="rounded"] {
      border-radius: var(--radius-lg);
    }
    &[data-shape="square"] {
      border-radius: var(--radius-sm);
    }

    /* a loaded photo covers the box: no muted plate behind a shaped image */
    &:has(> .avatar-image:not([data-error])) {
      background-color: transparent;
    }

    /* -- Ring: a colored ring with a background-colored gap, following
       the avatar's shape */
    &[data-ring] {
      box-shadow:
        0 0 0 2px var(--background),
        0 0 0 4px var(--primary);
    }
    &[data-ring="secondary"] {
      box-shadow:
        0 0 0 2px var(--background),
        0 0 0 4px var(--muted-foreground);
    }
    &[data-ring="destructive"] {
      box-shadow:
        0 0 0 2px var(--background),
        0 0 0 4px var(--destructive);
    }
  }

  .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
  }

  .avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background-color: var(--muted);
    position: absolute;
    inset: 0;
    border-radius: inherit; /* .avatar no longer clips - the fallback must round itself */

    /* placeholder colors (letters on a solid plate) */
    &[data-variant="primary"] {
      background-color: var(--primary);
      color: var(--primary-foreground);
    }
    &[data-variant="neutral"] {
      background-color: var(--foreground);
      color: var(--background);
    }
  }

  /* Hide fallback when image is loaded */
  .avatar:has(.avatar-image:not([data-error])) .avatar-fallback {
    display: none;
  }

  /* Status dot. data-variant picks the presence state; no variant = online
     (the historical green). Status colours are literals by design - the
     tweakcn token set has no success/warning pair (AGENTS.md token rule).
     Colour is never the only cue (WCAG 1.4.1): offline is a hollow ring,
     busy carries a bar, away clock hands - the four read apart in greyscale
     and in forced-colors mode. Every cue is PAINTED inside a full circle
     (no mask): the silhouette and its separating rim stay whole, so the dot
     always sits in front of the avatar. Size scales with the avatar
     (--_badge, set per data-size below); rim and cues scale with it.
     Name it with role="img" + aria-label. */
  .avatar-badge {
    --_rim: max(2px, calc(var(--_badge, 1.25rem) * 0.15));
    position: absolute;
    inset-inline-end: calc(var(--_rim) * -0.5);
    inset-block-end: calc(var(--_rim) * -0.5);
    z-index: 1;
    width: var(--_badge, 1.25rem);
    height: var(--_badge, 1.25rem);
    box-sizing: border-box;
    border-radius: 9999px;
    background-color: #16a34a;
    border: var(--_rim) solid var(--background);
    background-repeat: no-repeat;

    &[data-variant="online"] {
      background-color: #16a34a;
    }

    /* data-position: any of the four corners (default bottom-end); start /
       end are logical - in RTL, start is the right */
    &[data-position^="top"] {
      inset-block: calc(var(--_rim) * -0.5) auto;
    }
    &[data-position$="start"] {
      inset-inline: calc(var(--_rim) * -0.5) auto;
    }

    /* hollow ring: "not here" */
    &[data-variant="offline"] {
      background-color: var(--background);
      box-shadow: inset 0 0 0 max(2px, calc(var(--_badge, 1.25rem) * 0.14)) #9ca3af;
    }

    /* red with a bar: do not disturb */
    &[data-variant="busy"] {
      background-color: #dc2626;
      background-image: linear-gradient(#fff 0 0);
      background-size: 56% max(2px, calc(var(--_badge, 1.25rem) * 0.14));
      background-position: center;
    }

    /* amber with clock hands (12 → 3 o'clock): away / be right back */
    &[data-variant="away"] {
      background-color: #f59e0b;
      background-image: linear-gradient(#fff 0 0), linear-gradient(#fff 0 0);
      background-size:
        max(2px, calc(var(--_badge, 1.25rem) * 0.12)) 34%,
        30% max(2px, calc(var(--_badge, 1.25rem) * 0.12));
      /* hour hand: centred, from ~16% down to the centre; minute hand: from
         the centre to ~80% (percent positions: (box - layer) * p) */
      background-position:
        50% 24%,
        71% 50%;
    }
  }

  /* Avatar group - data-overlap="sm|lg" tightens / loosens the stack */
  .avatar-group {
    display: flex;
    align-items: center;

    & .avatar {
      border: 2px solid var(--background);
      margin-left: -0.5rem;

      &:first-child {
        margin-left: 0;
      }
    }
    &[data-overlap="sm"] :is(.avatar, .avatar-group-count):not(:first-child) {
      margin-left: -0.25rem;
    }
    &[data-overlap="lg"] :is(.avatar, .avatar-group-count):not(:first-child) {
      margin-left: -1rem;
    }
  }

  .avatar-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    border: 2px solid var(--background);
    margin-left: -0.5rem;
  }
}

/* Forced colors (Windows High Contrast) would repaint the status fills with
   the system Canvas colour and erase the dot. Presence colour carries meaning
   (like a chart series), so the badge keeps its own palette; the ring / bar /
   crescent shape cues stay as well. */
@media (forced-colors: active) {
  @layer components {
    .avatar-badge {
      forced-color-adjust: none;
    }
  }
}

/* ── components/badge/badge.css ── */
/* -- Badge component ------------------------------------------- */

@layer components {
  .badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.5rem;
    /* a pill never breaks its label or gets squeezed in a flex row (as in
       shadcn/ui) - a wrapped badge doubles its line-height into a lozenge */
    white-space: nowrap;
    flex-shrink: 0;

    /* -- Sizes: font, vertical padding and the line-height (which gives the
       pill its height) scale together. Default (no attribute) == md. */
    &[data-size="xs"] {
      font-size: 0.5625rem;
      padding: 0 0.375rem;
      line-height: 1.125rem;
    }
    &[data-size="sm"] {
      font-size: 0.625rem;
      padding: 0.0625rem 0.5rem;
      line-height: 1.25rem;
    }
    &[data-size="md"] {
      font-size: 0.6875rem;
      padding: 0.125rem 0.625rem;
      line-height: 1.5rem;
    }
    &[data-size="lg"] {
      font-size: 0.8125rem;
      padding: 0.1875rem 0.75rem;
      line-height: 1.75rem;
    }
    &[data-size="xl"] {
      font-size: 0.9375rem;
      padding: 0.25rem 0.875rem;
      line-height: 2rem;
    }

    &[data-variant="outline"] {
      border: 1px solid var(--border);
      color: var(--muted-foreground);
    }

    &[data-variant="secondary"] {
      background: var(--secondary);
      color: var(--secondary-foreground);
    }

    &[data-variant="default"] {
      background: var(--primary);
      color: var(--primary-foreground);
    }

    &[data-variant="destructive"] {
      background: var(--destructive);
      color: var(--destructive-foreground);
    }
  }
}

/* ── components/bubble/bubble.css ── */
/* -- Bubble component ---------------------------------------------- */
/* A chat message bubble: the surface only - avatars, names, timestamps and
   message actions belong to a message row around it. CSS only. */

@layer components {
  .bubble {
    --_bg: var(--primary);
    --_fg: var(--primary-foreground);
    --_bd: transparent;
    --_r: 1.125rem;
    --_rs: 0.3125rem;
    --_px: 0.875rem;
    --_py: 0.5rem;
    --_fs: 0.875rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: 80%;
    min-width: 0;

    /* -- Alignment: start = the other side (received), end = you (sent) */
    &[data-align="end"],
    .bubble-group[data-align="end"] > & {
      margin-inline-start: auto;
      align-items: flex-end;
    }

    /* -- Variants -------------------------------------------------- */
    &[data-variant="secondary"] {
      --_bg: var(--secondary);
      --_fg: var(--secondary-foreground);
    }
    &[data-variant="muted"] {
      --_bg: var(--muted);
      --_fg: var(--muted-foreground);
    }
    &[data-variant="tinted"] {
      --_bg: color-mix(in oklch, var(--primary) 12%, var(--background));
      --_fg: var(--foreground);
    }
    &[data-variant="outline"] {
      --_bg: var(--background);
      --_fg: var(--foreground);
      --_bd: var(--border);
    }
    &[data-variant="destructive"] {
      --_bg: color-mix(in oklch, var(--destructive) 12%, var(--background));
      --_fg: var(--destructive);
      --_bd: color-mix(in oklch, var(--destructive) 30%, transparent);
    }
    &[data-variant="ghost"] {
      --_bg: transparent;
      --_fg: var(--foreground);
      --_px: 0;
      max-width: none;
      width: 100%;
    }

    /* -- Sizes ------------------------------------------------------ */
    &[data-size="sm"] {
      --_r: 0.875rem;
      --_px: 0.625rem;
      --_py: 0.3125rem;
      --_fs: 0.8125rem;
    }
    &[data-size="lg"] {
      --_r: 1.375rem;
      --_px: 1.125rem;
      --_py: 0.75rem;
      --_fs: 1rem;
    }
  }

  .bubble-content {
    box-sizing: border-box;
    max-width: 100%;
    padding: var(--_py) var(--_px);
    border: 1px solid var(--_bd);
    border-radius: var(--_r);
    background: var(--_bg);
    color: var(--_fg);
    font: inherit;
    font-size: var(--_fs);
    line-height: 1.45;
    text-align: start;
    text-wrap: pretty;
    overflow-wrap: anywhere;

    & > :first-child {
      margin-block-start: 0;
    }
    & > :last-child {
      margin-block-end: 0;
    }
    & p {
      margin-block: 0 0.5em;
    }
    & a:not(.bubble-content) {
      color: inherit;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    & code {
      font-family: var(--font-mono);
      font-size: 0.9em;
      padding: 0.0625rem 0.3125rem;
      border-radius: 0.3125rem;
      background: color-mix(in oklch, currentColor 12%, transparent);
    }
    & img,
    & video {
      display: block;
      max-width: 100%;
      height: auto;
      border-radius: calc(var(--_r) - 0.375rem);
    }
    & :is(ul, ol) {
      margin-block: 0.25em 0.5em;
      padding-inline-start: 1.25em;
    }

    /* a whole bubble as a link or a button (quick replies, options) */
    &:is(a, button) {
      appearance: none;
      cursor: pointer;
      text-decoration: none;
      transition:
        background-color 150ms ease,
        border-color 150ms ease;
      &:hover {
        background: color-mix(in oklch, var(--_bg) 88%, var(--_fg));
      }
      &:focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
      }
      &:disabled,
      &[aria-disabled="true"] {
        opacity: 0.5;
        pointer-events: none;
      }
    }
  }
  .bubble[data-variant="ghost"] > .bubble-content:is(a, button):hover {
    background: var(--accent);
  }

  /* -- Media bubble: an image / video edge to edge ------------------ */
  .bubble-content[data-media] {
    padding: 0;
    overflow: hidden;
    & img,
    & video {
      border-radius: 0;
    }
    & .bubble-caption {
      padding: var(--_py) var(--_px);
    }
  }

  /* -- Collapsible content: a preview, the rest in a <details> ------- */
  .bubble-more {
    display: flex;
    flex-direction: column-reverse;

    & > summary {
      list-style: none;
      width: fit-content;
      margin-block-start: 0.25rem;
      font-weight: 500;
      text-decoration: underline;
      text-underline-offset: 2px;
      cursor: pointer;
      &::-webkit-details-marker {
        display: none;
      }
      &:focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
        border-radius: 0.25rem;
      }
    }
    & .bubble-more-open {
      display: none;
    }
    &[open] .bubble-more-open {
      display: inline;
    }
    &[open] .bubble-more-closed {
      display: none;
    }
    &::details-content {
      interpolate-size: allow-keywords;
      block-size: 0;
      overflow: clip;
      transition:
        block-size 220ms ease,
        content-visibility 220ms allow-discrete;
    }
    &[open]::details-content {
      block-size: auto;
    }
  }

  /* -- Reactions: overlapped emoji anchored to the bubble's edge ------- */
  .bubble-reactions {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    margin-block-start: -0.5rem;
    margin-inline: 0.625rem;
    padding: 0.125rem;
    border-radius: 9999px;
    background: var(--background);
    box-shadow:
      0 0 0 1px var(--border),
      var(--shadow-xs);
    font-size: 0.75rem;
    line-height: 1;

    & > * {
      display: grid;
      place-items: center;
      min-width: 1.375rem;
      height: 1.375rem;
      border-radius: 9999px;
      background: var(--background);
    }
    & > * + * {
      margin-inline-start: -0.3125rem;
      box-shadow: -2px 0 0 var(--background);
    }
    & > .bubble-reactions-count {
      padding-inline: 0.25rem 0.375rem;
      font-weight: 500;
      font-variant-numeric: tabular-nums;
      color: var(--muted-foreground);
      box-shadow: none;
      margin-inline-start: 0;
    }
    &[data-align="start"] {
      align-self: flex-start;
    }
    &[data-side="top"] {
      order: -1;
      margin-block: 0 -0.5rem;
    }
  }
  [dir="rtl"] .bubble-reactions > * + * {
    box-shadow: 2px 0 0 var(--background);
  }

  /* -- Group: consecutive bubbles of one sender, the joined corners
     tightened (logical radii, so RTL mirrors) ---------------------- */
  .bubble-group {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;

    & > .bubble {
      max-width: 80%;
    }
    & > .bubble:has(> .bubble-reactions:not([data-side="top"])):not(:last-child) {
      margin-block-end: 0.375rem;
    }

    /* received (start): the start-side corners between neighbours */
    &:not([data-align="end"]) > .bubble:not([data-align="end"]) {
      &:not(:last-child) > .bubble-content {
        border-end-start-radius: var(--_rs);
      }
      &:not(:first-child) > .bubble-content {
        border-start-start-radius: var(--_rs);
      }
    }
    /* sent (end) */
    &[data-align="end"] > .bubble,
    & > .bubble[data-align="end"] {
      &:not(:last-child) > .bubble-content {
        border-end-end-radius: var(--_rs);
      }
      &:not(:first-child) > .bubble-content {
        border-start-end-radius: var(--_rs);
      }
    }
  }

  /* -- Tail: data-tail on a bubble (or a group - its last bubble) draws
     a small curved tail at the bottom outer corner ------------------ */
  :is(.bubble[data-tail], .bubble-group[data-tail] > .bubble:last-child):not(
      [data-variant="ghost"],
      [data-variant="outline"],
      [data-variant="destructive"]
    )
    > .bubble-content {
    position: relative;
    border-end-start-radius: var(--_rs);

    &::before {
      /* thick against the bubble, tapering to a point at the outer bottom:
         an SVG path mask, mirrored for the end side and RTL */
      content: "";
      position: absolute;
      inset-block-end: -1px;
      inset-inline-start: -0.75rem;
      width: 0.875rem;
      height: 1.25rem;
      background: var(--_bg);
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M14 1C14 11 9 18 0 20H14Z'/%3E%3C/svg%3E")
        0 0 / 100% 100% no-repeat;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M14 1C14 11 9 18 0 20H14Z'/%3E%3C/svg%3E")
        0 0 / 100% 100% no-repeat;
    }
  }
  :is(
      .bubble[data-tail][data-align="end"],
      .bubble-group[data-tail][data-align="end"] > .bubble:last-child,
      .bubble-group[data-tail] > .bubble[data-align="end"]:last-child
    ):not([data-variant="ghost"], [data-variant="outline"], [data-variant="destructive"])
    > .bubble-content {
    border-end-start-radius: var(--_r);
    border-end-end-radius: var(--_rs);

    &::before {
      inset-inline-start: auto;
      inset-inline-end: -0.75rem;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M0 1C0 11 5 18 14 20H0Z'/%3E%3C/svg%3E")
        0 0 / 100% 100% no-repeat;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M0 1C0 11 5 18 14 20H0Z'/%3E%3C/svg%3E")
        0 0 / 100% 100% no-repeat;
    }
  }
  [dir="rtl"] :is(.bubble[data-tail], .bubble-group[data-tail] > .bubble:last-child) > .bubble-content::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M0 1C0 11 5 18 14 20H0Z'/%3E%3C/svg%3E")
      0 0 / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M0 1C0 11 5 18 14 20H0Z'/%3E%3C/svg%3E")
      0 0 / 100% 100% no-repeat;
  }
  [dir="rtl"]
    :is(
      .bubble[data-tail][data-align="end"],
      .bubble-group[data-tail][data-align="end"] > .bubble:last-child,
      .bubble-group[data-tail] > .bubble[data-align="end"]:last-child
    )
    > .bubble-content::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M14 1C14 11 9 18 0 20H14Z'/%3E%3C/svg%3E")
      0 0 / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 20' preserveAspectRatio='none'%3E%3Cpath d='M14 1C14 11 9 18 0 20H14Z'/%3E%3C/svg%3E")
      0 0 / 100% 100% no-repeat;
  }

  /* -- Typing: three dots that bounce while the other side writes ---- */
  .bubble-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: calc(var(--_fs) * 1.45);

    & > span {
      width: 0.4375rem;
      height: 0.4375rem;
      border-radius: 9999px;
      background: currentColor;
      opacity: 0.45;
      animation: bubble-typing 1.2s ease-in-out infinite;
      &:nth-child(2) {
        animation-delay: 0.15s;
      }
      &:nth-child(3) {
        animation-delay: 0.3s;
      }
    }
  }
  @keyframes bubble-typing {
    0%,
    60%,
    100% {
      translate: 0 0;
      opacity: 0.45;
    }
    30% {
      translate: 0 -0.25rem;
      opacity: 1;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .bubble-typing > span {
      animation: none;
      opacity: 0.7;
    }
    .bubble-more::details-content {
      transition: none;
    }
    .bubble-content:is(a, button) {
      transition: none;
    }
  }
}

@media (prefers-contrast: more) {
  @layer components {
    .bubble-content {
      border-color: var(--foreground);
    }
    .bubble[data-variant="ghost"] > .bubble-content {
      border-color: transparent;
    }
  }
}

@media (forced-colors: active) {
  @layer components {
    .bubble-content {
      border: 1px solid CanvasText;
      background: Canvas;
      color: CanvasText;
    }
    .bubble[data-variant="default"] > .bubble-content,
    .bubble:not([data-variant]) > .bubble-content {
      background: Highlight;
      color: HighlightText;
      forced-color-adjust: none;
    }
    .bubble-content::before {
      display: none;
    }
    .bubble-reactions {
      box-shadow: none;
      border: 1px solid CanvasText;
    }
  }
}

/* ── components/button/button.css ── */
/* -- Button component ------------------------------------------ */

@layer components {
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 150ms ease;
    outline: none;
    flex-shrink: 0;
    height: 2.25rem;
    padding: 0 1rem;
    background-color: var(--primary);
    color: var(--primary-foreground);

    & svg {
      pointer-events: none;
      flex-shrink: 0;

      &:not([class*="size-"]) {
        width: 1rem;
        height: 1rem;
      }
    }

    /* a loading .spinner inside a button takes the button's own text color —
       spinner.css defaults it to --muted-foreground, invisible on a primary */
    & .spinner {
      color: inherit;
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    &:disabled,
    &[aria-disabled="true"] {
      pointer-events: none;
      opacity: 0.5;
    }

    /* Loading state (aria-busy + a .spinner child): a disabled button must
       freeze its spinner - "pending" is signaled by the dimming, a frozen
       wheel is the accepted pattern; only an ENABLED busy button spins. */
    &:disabled .spinner,
    &[aria-disabled="true"] .spinner {
      animation-play-state: paused;
    }

    /* -- Variants -------------------------------------------- */
    &[data-variant="default"] {
      background-color: var(--primary);
      color: var(--primary-foreground);

      &:hover {
        opacity: 0.9;
      }
    }

    &[data-variant="secondary"] {
      background-color: var(--secondary);
      color: var(--secondary-foreground);

      /* --secondary is near-white in light themes, so an opacity fade would
         wash the button further into the page background (invisible hover).
         Mixing in the foreground color instead darkens light themes and
         lightens dark ones - always moving away from the page surface. */
      &:hover {
        background-color: color-mix(in oklch, var(--secondary) 85%, var(--secondary-foreground));
      }
    }

    &[data-variant="outline"] {
      background-color: var(--background);
      color: var(--foreground);
      border: 1px solid var(--border);
      box-shadow: var(--shadow-xs);

      &:hover {
        background-color: var(--accent);
        color: var(--accent-foreground);
      }
    }

    &[data-variant="ghost"] {
      background-color: transparent;
      color: var(--foreground);
      border-color: transparent;

      &:hover {
        background-color: var(--accent);
        color: var(--accent-foreground);
      }
    }

    &[data-variant="destructive"] {
      background-color: var(--destructive);
      color: var(--destructive-foreground);

      &:hover {
        opacity: 0.9;
      }
    }

    &[data-variant="link"] {
      background-color: transparent;
      color: var(--primary);
      height: auto;
      padding: 0;
      text-underline-offset: 4px;

      &:hover {
        text-decoration: underline;
      }
    }

    /* soft: a tint of the color, text in the color */
    &[data-variant="soft"] {
      background-color: color-mix(in oklch, var(--primary) 12%, transparent);
      color: color-mix(in oklch, var(--primary) 80%, var(--foreground));

      &:hover {
        background-color: color-mix(in oklch, var(--primary) 20%, transparent);
      }
    }

    /* dashed: a drop-zone / "add" look */
    &[data-variant="dashed"] {
      background-color: transparent;
      color: var(--foreground);
      border: 1px dashed color-mix(in oklch, var(--foreground) 35%, transparent);

      &:hover {
        background-color: var(--accent);
        color: var(--accent-foreground);
        border-style: solid;
      }
    }

    /* -- Tones: any variant in another color -------------------
       data-tone="success" / "warning" / "info" / "destructive" - or
       data-tone="custom" with style="--btn-color: …; --btn-color-fg: …"
       (the text on a solid fill, default white). Solid buttons fill with the
       tone; outline / ghost / soft / dashed / link write in it, mixed toward
       the foreground so a light tone (amber) stays readable. */
    &[data-tone] {
      --_tone: var(--btn-color, var(--primary));
      --_tone-fg: var(--btn-color-fg, #fff);
      --_tone-ink: color-mix(in oklch, var(--_tone) 78%, var(--foreground));
    }
    &[data-tone="success"] {
      --_tone: oklch(0.6 0.15 150);
    }
    &[data-tone="warning"] {
      --_tone: oklch(0.8 0.16 80);
      --_tone-fg: oklch(0.28 0.06 60);
    }
    &[data-tone="info"] {
      --_tone: oklch(0.6 0.16 250);
    }
    &[data-tone="destructive"] {
      --_tone: var(--destructive);
      --_tone-fg: var(--destructive-foreground, #fff);
    }

    &[data-tone]:is(:not([data-variant]), [data-variant="default"]) {
      background-color: var(--_tone);
      color: var(--_tone-fg);

      &:hover {
        opacity: 0.9;
      }
    }
    &[data-tone][data-variant="outline"] {
      background-color: transparent;
      color: var(--_tone-ink);
      border-color: var(--_tone);

      &:hover {
        background-color: color-mix(in oklch, var(--_tone) 12%, transparent);
        color: var(--_tone-ink);
      }
    }
    &[data-tone]:is([data-variant="ghost"], [data-variant="dashed"]) {
      color: var(--_tone-ink);

      &:hover {
        background-color: color-mix(in oklch, var(--_tone) 14%, transparent);
        color: var(--_tone-ink);
      }
    }
    &[data-tone][data-variant="dashed"] {
      border-color: var(--_tone);
    }
    &[data-tone][data-variant="soft"] {
      background-color: color-mix(in oklch, var(--_tone) 16%, transparent);
      color: var(--_tone-ink);

      &:hover {
        background-color: color-mix(in oklch, var(--_tone) 26%, transparent);
      }
    }
    &[data-tone][data-variant="link"] {
      color: var(--_tone-ink);
    }

    /* -- RTL: arrows and other directional icons mirror ----------
       mark them data-rtl-flip; symmetric icons stay as they are */
    &:dir(rtl) [data-rtl-flip] {
      scale: -1 1;
    }

    /* -- Sizes ----------------------------------------------- */
    &[data-size="xs"] {
      height: 1.75rem;
      padding: 0 0.5rem;
      font-size: 0.75rem;
      border-radius: var(--radius-sm);
    }
    &[data-size="sm"] {
      height: 2rem;
      padding: 0 0.75rem;
      font-size: 0.8125rem;
    }
    &[data-size="md"] {
      height: 2.25rem;
      padding: 0 1rem;
      font-size: 0.875rem;
    }
    &[data-size="lg"] {
      height: 2.75rem;
      padding: 0 2rem;
      font-size: 1rem;
    }
    &[data-size="xl"] {
      height: 3.25rem;
      padding: 0 2.5rem;
      font-size: 1.125rem;
    }
    &[data-size="icon"] {
      height: 2.25rem;
      width: 2.25rem;
      padding: 0;
    }
    &[data-size="icon-xs"] {
      height: 1.75rem;
      width: 1.75rem;
      padding: 0;
      border-radius: var(--radius-sm);
    }
    &[data-size="icon-sm"] {
      height: 2rem;
      width: 2rem;
      padding: 0;
    }
    &[data-size="icon-lg"] {
      height: 2.75rem;
      width: 2.75rem;
      padding: 0;
    }
    &[data-size="icon-xl"] {
      height: 3.25rem;
      width: 3.25rem;
      padding: 0;
    }
  }

  /* -- Accessibility ------------------------------------------ */

  @media (prefers-reduced-motion: reduce) {
    .btn {
      transition: none;
    }
  }

  @media (prefers-contrast: more) {
    .btn {
      border: 2px solid transparent;

      &[data-variant="default"],
      &[data-variant="secondary"],
      &[data-variant="destructive"] {
        border-color: currentColor;
      }

      &[data-variant="outline"],
      &[data-variant="ghost"] {
        border-color: var(--foreground);
      }
    }
  }

  @media (forced-colors: active) {
    .btn {
      border: 1px solid ButtonText;

      &:disabled,
      &[aria-disabled="true"] {
        border-color: GrayText;
        color: GrayText;
      }
    }
  }
}

/* ── components/card/card.css ── */
/* -- Card component -------------------------------------------- */

@layer components {
  /* Spacing runs through one private variable: --_pad (section padding) =
     --_base (the SIZE's padding, md 1.5rem) × --_k (the DENSITY factor), and
     --_hf (the header→footer gap when no content sits between them) =
     --_hfb × --_kh. Size and density therefore combine instead of fighting.
     --_title / --_desc carry the size's type scale. All private. */
  .card {
    --_base: 1.5rem;
    --_hfb: 1rem;
    --_k: 1;
    --_kh: 1;
    --_pad: calc(var(--_base) * var(--_k));
    --_hf: calc(var(--_hfb) * var(--_kh));
    background-color: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    container-type: inline-size;
  }

  .card-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--_pad, 1.5rem);
    padding-bottom: 0;
  }

  .card-title {
    font-size: var(--_title, 1.25rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
  }

  .card-description {
    font-size: var(--_desc, 0.875rem);
    color: var(--muted-foreground);
    margin: 0;
    line-height: 1.6;
  }

  .card-content {
    padding: var(--_pad, 1.5rem);
  }

  .card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--_pad, 1.5rem);
    padding-top: 0;
  }

  /* Header + footer with no .card-content between: the zeroed paddings would
     glue them together - restore the gap for that composition only. */
  .card-header + .card-footer {
    padding-top: var(--_hf, 1rem);
  }

  /* A header-only card (a title + description panel): the header is the last
     section, so it keeps its bottom padding instead of sitting on the edge. */
  .card-header:last-child {
    padding-bottom: var(--_pad, 1.5rem);
  }

  /* -- Body: an optional wrapper around header / content / footer.
     Needed for the side and overlay layouts (media | body); in a column it
     pushes the footer to the bottom, so a row of cards lines up its actions. */
  .card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;

    & > .card-footer {
      margin-top: auto;
    }
  }

  /* -- Media: a figure (img / video / picture / svg) edge to edge - first
     child for an image on top, last child for one at the bottom. 16:9 unless
     the author sets an aspect-ratio. data-inset pads and rounds it instead
     (the centered-content look). */
  .card-media {
    display: block;
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;

    & > :is(img, video, picture, svg) {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    &[data-inset] {
      margin: var(--_pad) var(--_pad) 0;
      border-radius: var(--radius-lg);
    }
    &[data-inset]:last-child {
      margin: 0 var(--_pad) var(--_pad);
    }
  }

  /* -- Density --------------------------------------------------
     data-density on the .card root scales the section paddings together.
     Scale matches sizing.css data-density (0.75 / 1 / 1.25): comfortable is
     the unsized default (1.5rem), compact 1rem, spacious 2rem; the
     header+footer-only gap (1rem base) follows the ratio (0.75 / 1 / 1.5). */
  .card:where([data-density="compact"]) {
    --_k: calc(2 / 3);
    --_kh: 0.75;
  }
  .card:where([data-density="comfortable"]) {
    --_k: 1;
    --_kh: 1;
  }
  .card:where([data-density="spacious"]) {
    --_k: calc(4 / 3);
    --_kh: 1.5;
  }

  .card {
    /* -- Sizes: padding + type scale together (md == the default) ----- */
    &[data-size="xs"] {
      --_base: 0.75rem;
      --_hfb: 0.5rem;
      --_title: 0.875rem;
      --_desc: 0.75rem;
    }
    &[data-size="sm"] {
      --_base: 1rem;
      --_hfb: 0.75rem;
      --_title: 1rem;
      --_desc: 0.8125rem;
    }
    &[data-size="md"] {
      --_base: 1.5rem;
      --_hfb: 1rem;
      --_title: 1.25rem;
      --_desc: 0.875rem;
    }
    &[data-size="lg"] {
      --_base: 2rem;
      --_hfb: 1.25rem;
      --_title: 1.5rem;
      --_desc: 1rem;
    }
    &[data-size="xl"] {
      --_base: 2.5rem;
      --_hfb: 1.5rem;
      --_title: 1.875rem;
      --_desc: 1.0625rem;
    }

    /* -- Variants -------------------------------------------------- */
    &[data-variant="outline"] {
      background-color: transparent;
    }
    &[data-variant="dashed"] {
      border-style: dashed;
      border-width: 2px;
    }
    &[data-variant="ghost"] {
      background-color: transparent;
      border-color: transparent;
    }
    &[data-variant="muted"] {
      background-color: var(--muted);
      border-color: transparent;
    }
    &[data-variant="elevated"] {
      border-color: transparent;
      box-shadow: var(--shadow-lg);
    }
    &[data-variant="primary"] {
      background-color: var(--primary);
      color: var(--primary-foreground);
      border-color: transparent;

      & .card-description {
        color: color-mix(in oklch, var(--primary-foreground) 78%, transparent);
      }
    }
    /* a charcoal surface: the inverse colors, softened (78%) so it stays
       apart from --primary - in the default theme primary IS near-black */
    &[data-variant="neutral"] {
      background-color: color-mix(in oklch, var(--foreground) 78%, var(--background));
      color: var(--background);
      border-color: transparent;

      & .card-description {
        color: color-mix(in oklch, var(--background) 72%, transparent);
      }
    }
    /* ghost / link buttons on a colored surface take its text color and a
       hover tint made from it (the default hover - the pale --accent - would
       put near-white text on near-white) */
    &:is([data-variant="primary"], [data-variant="neutral"], [data-layout="overlay"])
      .btn:is([data-variant="ghost"], [data-variant="link"]) {
      color: inherit;

      &:hover {
        background-color: color-mix(in oklch, currentColor 16%, transparent);
        color: inherit;
      }
    }
    /* frosted: translucent card over whatever is behind it */
    &[data-variant="glass"] {
      background-color: color-mix(in oklch, var(--card) 55%, transparent);
      border-color: color-mix(in oklch, var(--foreground) 14%, transparent);
      backdrop-filter: blur(16px) saturate(1.4);
      box-shadow: 0 8px 32px -8px color-mix(in oklch, var(--foreground) 22%, transparent);
    }

    /* -- Centered content ------------------------------------------ */
    &[data-align="center"] {
      text-align: center;

      & .card-header {
        align-items: center;
      }
      & .card-footer {
        justify-content: center;
      }
    }

    /* -- Layouts ---------------------------------------------------
       side: media | body in one row, always (media after the body = image
       on the right). auto: side by side while the CARD is wide enough,
       stacked when it is not - the flex-wrap switch follows the card's own
       width, not the viewport, so the same card works in a sidebar and in a
       wide column. overlay: the media is the background, the body sits on
       a scrim at the bottom. */
    &[data-layout="side"] {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);

      & > .card-media {
        aspect-ratio: auto;
        min-height: 100%;
      }
    }
    &[data-layout="side"]:has(> .card-body:first-child) {
      grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }
    &[data-layout="auto"] {
      display: flex;
      flex-wrap: wrap;

      & > .card-media {
        flex: 1 1 12rem;
        aspect-ratio: auto;
        min-height: 10rem;
      }
      & > .card-body {
        flex: 999 1 18rem;
      }
    }
    &[data-layout="overlay"] {
      display: grid;
      color: #fff;
      border-color: transparent;

      & > * {
        grid-area: 1 / 1;
      }
      & > .card-media {
        aspect-ratio: auto;
        min-height: 14rem;
      }
      & > .card-body {
        z-index: 1;
        align-self: end;
        background: linear-gradient(to top, oklch(0 0 0 / 0.78), oklch(0 0 0 / 0.35) 65%, transparent);
        padding-top: 3rem;
      }
      & .card-description {
        color: oklch(1 0 0 / 0.82);
      }
    }

    /* -- Interactive: a link (or [data-interactive]) card lifts on hover
       and shows a focus ring on keyboard focus ------------------------ */
    &:is(a, [data-interactive]) {
      display: block;
      text-decoration: none;
      transition:
        translate 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease;

      &:hover {
        translate: 0 -2px;
        box-shadow: var(--shadow-md);
        border-color: color-mix(in oklch, var(--foreground) 22%, var(--border));
      }
      &:focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
      }
    }
    &:is(a, [data-interactive])[data-layout="auto"] {
      display: flex;
    }
    &:is(a, [data-interactive]):is([data-layout="side"], [data-layout="overlay"]) {
      display: grid;
    }

    /* -- Selectable: a <label class="card"> around a checkbox / radio -
       the checked card takes a primary ring; keyboard focus shows too */
    &:is(label) {
      display: block;
      cursor: pointer;
      transition:
        border-color 150ms ease,
        box-shadow 150ms ease;

      &:has(:is(input[type="checkbox"], input[type="radio"]):checked) {
        border-color: var(--primary);
        box-shadow: 0 0 0 1px var(--primary);
      }
      &:has(input:focus-visible) {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
      }
      &:has(input:disabled) {
        cursor: not-allowed;
        opacity: 0.55;
      }
    }
  }

  /* -- Container query: compact card in narrow containers - unless the
     card asks for a size (an explicit data-size wins) -- */
  @container (max-width: 280px) {
    .card:not([data-size]) :is(.card-header, .card-content, .card-footer) {
      --_pad: 1rem;
    }
    .card:not([data-size]) .card-title {
      font-size: 1rem;
    }
  }

  /* -- Accessibility ------------------------------------------ */
  @media (prefers-reduced-motion: reduce) {
    .card:is(a, [data-interactive]) {
      transition: none;
    }
    .card:is(a, [data-interactive]):hover {
      translate: none;
    }
  }
  @media (forced-colors: active) {
    .card:is(label):has(:is(input[type="checkbox"], input[type="radio"]):checked) {
      border: 2px solid Highlight;
    }
  }
}

/* ── components/chat-components/chat-components.css ── */
@layer components {
  /* A Component Schema document shown in a chat: a Card of content, fields and actions inside a message. */
  .chat-components {
    display: block;
    /* a definite width: inside a shrink-to-fit message a percentage alone resolves to nothing */
    inline-size: 34rem;
    max-inline-size: 100%;

    & > script {
      display: none;
    }
  }

  .chat-components-card {
    text-align: start;
  }

  .chat-components-content {
    display: grid;
    gap: 1rem;
    min-inline-size: 0;

    & > :is(p, ul, ol, dl) {
      margin: 0;
    }
  }

  .chat-components-text {
    line-height: 1.55;
    text-wrap: pretty;

    & code {
      font-family: var(--font-mono);
      font-size: 0.875em;
    }
  }

  .chat-components-list {
    padding-inline-start: 1.25rem;
    display: grid;
    gap: 0.25rem;
    line-height: 1.5;
  }

  .chat-components-field {
    display: grid;
    gap: 0.375rem;
    min-inline-size: 0;

    & > .label {
      margin: 0;
    }
  }

  .chat-components-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-wrap: pretty;
  }

  /* a radio / checkbox group and a rating: a fieldset with its legend as the label */
  .chat-components-group {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    min-inline-size: 0;

    & > legend {
      padding: 0;
      margin-block-end: 0.5rem;
    }
  }

  .chat-components-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;

    & > input:is(.radio, .checkbox) {
      margin-block-start: 0.125rem;
      flex: none;
    }

    & > label {
      display: grid;
      gap: 0.125rem;
      font-size: 0.875rem;
      line-height: 1.4;
      cursor: pointer;
    }

    /* "Other": its text field follows the choice */
    &[data-other] {
      flex-wrap: wrap;
      align-items: center;

      & > .chat-components-other {
        flex: 1 1 10rem;
        inline-size: auto;
        min-inline-size: 0;
      }
    }
  }

  .chat-components-choice-description {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
  }

  .chat-components-switch {
    flex-wrap: wrap;

    & > .chat-components-hint {
      flex-basis: 100%;
    }
  }

  .chat-components-slider {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    & > .slider {
      flex: 1;
      min-inline-size: 0;
    }
  }

  .chat-components-output {
    min-inline-size: 3ch;
    font-variant-numeric: tabular-nums;
    font-size: 0.875rem;
    text-align: end;
  }

  /* facts: a definition list of label / value rows (also the answers of a questionnaire) */
  .chat-components-facts {
    display: grid;
    gap: 0;
    font-size: 0.875rem;

    & > div {
      display: grid;
      grid-template-columns: minmax(6rem, 40%) 1fr;
      gap: 0.75rem;
      padding-block: 0.5rem;
      border-block-end: 1px solid var(--border);

      &:last-child {
        border-block-end: 0;
      }
    }

    & dt {
      color: var(--muted-foreground);
    }

    & dd {
      margin: 0;
      font-weight: 500;
      overflow-wrap: anywhere;
    }
  }

  /* a plan: numbered steps, optionally each with a checkbox */
  .chat-components-plan {
    display: grid;
    gap: 0.625rem;
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: chat-plan;

    & > li {
      display: grid;
      grid-template-columns: 1.5rem 1fr;
      gap: 0.5rem;
      align-items: start;
      counter-increment: chat-plan;

      &::before {
        content: counter(chat-plan);
        display: grid;
        place-items: center;
        inline-size: 1.5rem;
        block-size: 1.5rem;
        border-radius: 999px;
        background: var(--muted);
        color: var(--muted-foreground);
        font-size: 0.75rem;
        font-weight: 600;
      }

      & > label {
        display: grid;
        gap: 0.125rem;
        cursor: pointer;
      }
    }

    &[data-checkable] > li {
      grid-template-columns: 1.5rem auto 1fr;

      & > .checkbox {
        margin-block-start: 0.25rem;
      }
    }
  }

  .chat-components-plan-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
  }

  .chat-components-plan-description {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
  }

  .chat-components-questionnaire {
    max-inline-size: none;
  }

  .chat-components-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* answered or cancelled: only the chosen action stays, marked */
  .chat-components[data-answered] {
    & .chat-components-actions > [data-chat-action]:not([data-chosen]) {
      display: none;
    }

    & [data-chat-action][data-chosen] {
      opacity: 1;
      pointer-events: none;

      &::before {
        content: "\2713";
        margin-inline-end: 0.25rem;
      }
    }

    & .chat-components-content :is(input, select, textarea):disabled {
      opacity: 1;
      cursor: default;
    }
  }

  .chat-components[data-answered="cancelled"] .chat-components-content {
    opacity: 0.6;
  }

  @media (prefers-reduced-motion: reduce) {
    .chat-components * {
      transition: none;
      animation: none;
    }
  }

  @media (prefers-contrast: more) {
    .chat-components-hint,
    .chat-components-choice-description,
    .chat-components-plan-description,
    .chat-components-facts dt {
      color: var(--foreground);
    }
  }

  @media (forced-colors: active) {
    .chat-components-plan > li::before {
      border: 1px solid CanvasText;
    }

    .chat-components[data-answered] [data-chat-action][data-chosen] {
      border: 2px solid Highlight;
    }
  }
}

/* ── components/checkbox/checkbox.css ── */
/* -- Checkbox component ----------------------------------------- */

@layer components {
  .checkbox {
    appearance: none;
    margin: 0; /* kill the UA's ~4px input margin - breaks flex/grid rhythm */
    width: 1.125rem;
    height: 1.125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition:
      background-color 150ms,
      border-color 150ms;

    &:checked {
      background-color: var(--primary);
      border-color: var(--primary);

      &::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 45%;
        width: 6px;
        height: 10px;
        border: solid var(--primary-foreground);
        border-width: 0 2px 2px 0;
        transform: translate(-50%, -50%) rotate(45deg);
      }
    }

    /* Per spec, an indeterminate checkbox ALSO matches :checked - both
       ::after rules land on the element, so the dash must explicitly cancel
       the checkmark's border (else the rotated border renders on top of it). */
    &:indeterminate {
      background-color: var(--primary);
      border-color: var(--primary);

      &::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 10px;
        height: 2px;
        border: none;
        background: var(--primary-foreground);
        transform: translate(-50%, -50%);
      }
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    /* Disabled = legible but inert: never an opacity fade (0.5 on a light
       --border edge left a ghost you had to look for). The shape keeps its
       full-strength edge, the surface turns muted, a chosen state keeps a
       softened primary fill, and the label goes muted with the no-entry
       cursor - "a choice that exists but is unavailable right now". */
    &:disabled {
      background-color: var(--muted);
      /* a mid-grey edge: --border on the muted fill is too faint to read as a box */
      border-color: color-mix(in oklch, var(--muted-foreground) 50%, var(--background));
      cursor: not-allowed;

      &:is(:checked, :indeterminate) {
        background-color: color-mix(in oklch, var(--primary) 45%, var(--background));
        border-color: transparent;
      }
    }

    &:is([aria-invalid="true"], :user-invalid:not(form[data-validate="submit"]:not([data-submitted]) *)) {
      border-color: var(--destructive);
    }
  }

  /* -- Checkbox item layout --------------------------------- */
  .checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    & > label {
      font-size: 0.875rem;
      cursor: pointer;
      /* leading-none (shadcn parity): a 1.6 line-box centers the LINE, not
         the glyphs - baseline then floats with the font's ascent, so text
         rides visibly off the box midline (worst with metric-heavy
         fallbacks). line-height:1 shrinks the box to the glyphs themselves. */
      line-height: 1;
    }
  }

  .checkbox-item-block {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;

    & > label {
      font-size: 0.875rem;
      cursor: pointer;
    }

    & > .checkbox {
      margin-top: 0.125rem;
    }
  }

  /* Gap hit area: inside an item layout the control's click target spans
     the gap to its label (a transparent ::before, part of the input's own
     hit box), so clicking the whitespace between control and text toggles
     too - the label's `for` covers the text itself. Inline-end only: the
     label always sits after the control (block layouts place it in the
     second grid column). */
  :is(.checkbox-item, .checkbox-item-block) > .checkbox::before {
    content: "";
    position: absolute;
    inset-block: -0.25rem;
    inset-inline: -0.25rem calc(-1 * 0.5rem);
  }

  /* Disabled auto-styling */
  .checkbox-item:has(.checkbox:disabled),
  .checkbox-item-block:has(.checkbox:disabled) {
    cursor: not-allowed;

    /* the text says "unavailable" too - and never offers the hand pointer
       for a click that cannot land */
    & label {
      color: var(--muted-foreground);
      cursor: not-allowed;
    }
  }

  /* -- Accessibility ---------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .checkbox {
      transition: none;
    }
  }

  @media (prefers-contrast: more) {
    .checkbox {
      border-width: 2px;
    }

    .checkbox:disabled {
      border-color: var(--muted-foreground);
    }
  }

  @media (forced-colors: active) {
    .checkbox {
      appearance: auto;
    }
  }
}

/* ── components/combobox/combobox.css ── */
/* -- Combobox component ---------------------------------------- */

@layer components {
  .combobox {
    position: relative;

    /* -- Sizes: set data-size on the .combobox wrapper; the trigger (a
       .btn) and the popover's rows scale together. Heights/fonts mirror the
       field ladder the .input defines: the unsized trigger renders 2.5rem —
       the .input default - via the .combobox-trigger rule below, md = 2.25rem
       is the ladder's md, exactly like .input goes 2.5rem → 2.25rem at md. */
    &[data-size="xs"] {
      & .combobox-trigger {
        height: 1.75rem;
        padding: 0 0.5rem;
        font-size: 0.75rem;
      }
      & .combobox-item,
      & .combobox-group-label {
        font-size: 0.75rem;
        padding-block: 0.25rem;
      }
    }
    &[data-size="sm"] {
      & .combobox-trigger {
        height: 2rem;
        padding: 0 0.625rem;
        font-size: 0.8125rem;
      }
      & .combobox-item,
      & .combobox-group-label {
        font-size: 0.8125rem;
        padding-block: 0.3125rem;
      }
    }
    &[data-size="md"] {
      & .combobox-trigger {
        height: 2.25rem;
      }
    }
    &[data-size="lg"] {
      & .combobox-trigger {
        height: 2.75rem;
        padding: 0 1rem;
        font-size: 1rem;
      }
      & .combobox-item,
      & .combobox-group-label {
        font-size: 1rem;
        padding-block: 0.5rem;
      }
    }
    &[data-size="xl"] {
      & .combobox-trigger {
        height: 3.25rem;
        padding: 0 1.25rem;
        font-size: 1.125rem;
      }
      & .combobox-item,
      & .combobox-group-label {
        font-size: 1.125rem;
        padding-block: 0.625rem;
      }
    }
  }

  .combobox-trigger {
    width: 100%;
    justify-content: space-between;
    /* the field standard for the unsized default (see .input): the ladder's
       md step - identical to what a bare .btn renders, so no override is
       needed beyond pinning it explicitly against .btn base drift */
    height: 2.25rem;
  }

  .combobox-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
    font-weight: 400;
  }

  .combobox-value[data-placeholder] {
    color: var(--muted-foreground);
  }

  .combobox-chevron {
    flex-shrink: 0;
    color: var(--muted-foreground);
    opacity: 0.5;
  }

  /* Clear button (injected by combobox.js after the trigger). Anchor-positioned
     over the trigger's chevron slot; anchored via the same per-instance anchor
     name the popover uses. `data-placeholder` presence is the single
     selection marker - the :has() rules below flip chevron and clear in sync,
     so no JS toggles visibility. */
  .combobox-clear {
    position: fixed;
    inset: auto;
    margin: 0;
    top: anchor(top);
    bottom: anchor(bottom);
    right: anchor(right);
    /* center the 20px box exactly over the 16px chevron (1rem trigger padding) */
    margin-inline-end: 0.875rem;
    width: 1.25rem;
    display: none;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;

    &:hover {
      color: var(--foreground);
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 1px;
    }
  }

  .combobox:has(.combobox-value:not([data-placeholder])) {
    & .combobox-clear {
      display: grid;
    }
    & .combobox-chevron {
      display: none;
    }
  }

  /* -- Multi-select (data-multiple) --------------------------------
     Options show a checkbox (empty box → filled with a check), the chosen
     options sit as removable tags under the trigger. The check is ::after,
     painted in --primary-foreground over the ::before box, so it stays
     visible in light and dark (primary flips, its foreground flips with it). */
  .combobox[data-multiple] .combobox-item {
    padding-inline-start: 1.875rem;

    &::before {
      content: "";
      position: absolute;
      inset-inline-start: 0.5rem;
      top: 50%;
      width: 1rem;
      height: 1rem;
      transform: translateY(-50%);
      box-sizing: border-box;
      border: 1px solid var(--input);
      border-radius: calc(var(--radius-sm) * 0.75);
      background: var(--background);
      mask: none;
    }

    &[aria-selected="true"]::before {
      border-color: var(--primary);
      background-color: var(--primary);
      mask: none;
    }

    &[aria-selected="true"]::after {
      content: "";
      position: absolute;
      inset-inline-start: 0.625rem;
      top: 50%;
      width: 0.75rem;
      height: 0.75rem;
      transform: translateY(-50%);
      background-color: var(--primary-foreground);
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
        center / contain no-repeat;
    }
  }

  .combobox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;

    /* nothing chosen: no empty gap under the trigger */
    &:not(:has(.combobox-tag)) {
      display: none;
    }
  }

  .combobox-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.125rem 0.25rem 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
  }

  .combobox-tag-remove {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    padding: 0;
    border: none;
    border-radius: calc(var(--radius-sm) * 0.75);
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;

    &:hover {
      background-color: color-mix(in oklch, var(--foreground) 10%, transparent);
      color: var(--foreground);
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 1px;
    }
  }

  /* -- Tag input (data-tags) ----------------------------------------
     Tags INSIDE a field-like box, typed into directly: .combobox-field looks
     like .input (same border, radius, ring on focus-within), the tags and the
     text input wrap together, the input takes the remaining width. */
  .combobox-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    box-sizing: border-box;
    min-height: 2.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    box-shadow: var(--shadow-xs);
    cursor: text;
    transition:
      border-color 150ms,
      box-shadow 150ms;

    &:focus-within {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    /* the tag span dissolves into the field's wrap (tags + input flow together) */
    & > .combobox-tags {
      display: contents;
    }

    & .combobox-tag {
      line-height: 1.375rem;
    }
  }

  .combobox-field-input {
    flex: 1 1 6rem;
    min-width: 6rem;
    height: 1.625rem;
    padding: 0 0.25rem;
    border: none;
    outline: none;
    background: transparent;
    color: var(--foreground);
    font: inherit;
    font-size: 0.875rem;

    &::placeholder {
      color: var(--muted-foreground);
    }
  }

  /* "Create …" row: a plus instead of the checkbox */
  .combobox[data-multiple] .combobox-item.combobox-create {
    color: var(--muted-foreground);

    &::before {
      border: none;
      border-radius: 0;
      background-color: currentColor;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")
        center / contain no-repeat;
    }

    &[data-highlighted] {
      color: var(--accent-foreground);
    }
  }

  .combobox-content {
    position: fixed;
    inset: auto;
    margin: 0;
    padding: 0;
    background-color: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;

    /* -- Anchor positioning -- */
    top: anchor(bottom);
    left: anchor(left);
    width: anchor-size(width);
    margin-top: 4px;
    position-try-fallbacks: flip-block;

    /* -- Animation --------------------------------------------- */
    opacity: 0;
    transform: scale(0.96) translateY(-0.25rem);
    transition:
      opacity 150ms ease,
      transform 150ms ease,
      display 150ms allow-discrete;

    &:popover-open {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  @starting-style {
    .combobox-content:popover-open {
      opacity: 0;
      transform: scale(0.96) translateY(-0.25rem);
    }
  }

  .combobox-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
  }

  .combobox-search-icon {
    flex-shrink: 0;
    color: var(--muted-foreground);
  }

  .combobox-search-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--foreground);
    outline: none;

    &::placeholder {
      color: var(--muted-foreground);
    }
  }

  .combobox-listbox {
    max-height: 16rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.25rem;
  }

  .combobox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: calc(var(--radius) * 0.6);
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    transition: background 100ms;
    /* room for the selection check; the ::before is absolute (like
       .dropdown-check) so unselected rows never shift horizontally */
    padding-inline-start: 1.5rem;
    position: relative;

    &:hover,
    &[data-highlighted] {
      background-color: var(--accent);
      color: var(--accent-foreground);
    }

    /* Mask (not background-image): a data: URI SVG resolves currentColor to
       BLACK when used as an image, making the check invisible in dark mode.
       Masking paints it with background-color: currentColor - the real text
       color, hover/foreground included. */
    &[aria-selected="true"]::before {
      content: "";
      position: absolute;
      inset-inline-start: 0.375rem;
      top: 50%;
      transform: translateY(-50%);
      width: 1rem;
      height: 1rem;
      background-color: currentColor;
      mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
      mask-size: contain;
      mask-repeat: no-repeat;
      flex-shrink: 0;
    }

    &[aria-disabled="true"] {
      pointer-events: none;
      opacity: 0.5;
    }

    /* Author `display: flex` overrides the UA's [hidden] { display: none }
       (author origin always wins), so filter()'s item.hidden = true left
       non-matching options rendered - and clickable - in the list. */
    &[hidden] {
      display: none;
    }
  }

  .combobox-empty {
    padding: 1.5rem 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
  }

  .combobox-group-label {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
  }

  .combobox-separator {
    height: 1px;
    background: var(--border);
    margin: 0.25rem -0.25rem;
  }

  /* -- Accessibility ------------------------------------------ */

  @media (prefers-reduced-motion: reduce) {
    .combobox-content {
      transition: none;
    }
    .combobox-item {
      transition: none;
    }
  }

  @media (forced-colors: active) {
    .combobox-content {
      border-color: ButtonText;
    }
    .combobox-item {
      &:hover,
      &[data-highlighted] {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
      }
    }
  }
}

/* ── components/dialog/dialog.css ── */
/* -- Dialog component ------------------------------------------ */

@layer components {
  dialog.dialog {
    border: none;
    border-radius: var(--radius-xl);
    background-color: var(--popover);
    color: var(--popover-foreground);
    padding: 0;
    margin: auto;
    position: fixed;
    inset: 0;
    max-width: 28rem;
    width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    box-shadow:
      0 25px 80px oklch(0 0 0 / 0.25),
      0 0 0 1px var(--border);
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.98);
    transition:
      opacity 200ms ease,
      transform 200ms ease,
      display 200ms allow-discrete;

    &[open] {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    /* -- Sizes ------------------------------------------------ */
    &[data-size="sm"] {
      max-width: 24rem;
    }
    &[data-size="md"] {
      max-width: 28rem;
    }
    &[data-size="lg"] {
      max-width: 32rem;
    }
    &[data-size="xl"] {
      max-width: 40rem;
    }
    &[data-size="full"] {
      max-width: calc(100vw - 2rem);
    }

    /* -- Backdrop --------------------------------------------- */
    &::backdrop {
      background: oklch(0 0 0 / 0);
      backdrop-filter: blur(0px);
      transition:
        all 200ms ease,
        display 200ms allow-discrete;
    }

    &[open]::backdrop {
      background: oklch(0 0 0 / 0.45);
      backdrop-filter: blur(3px);
    }
  }

  @starting-style {
    dialog.dialog[open] {
      opacity: 0;
      transform: translateY(-0.5rem) scale(0.98);
    }

    dialog.dialog[open]::backdrop {
      background: oklch(0 0 0 / 0);
      backdrop-filter: blur(0px);
    }
  }

  /* -- Scroll lock ------------------------------------------- */
  /* While the dialog is modal the page behind must stay put - closing
     returns you to exactly the scroll offset you had. `:modal` matches only
     while opened via showModal(); overflow:hidden freezes the viewport
     without losing the scroll position (no JS position:fixed hack), and
     scrollbar-gutter:stable keeps the scrollbar's space reserved so its
     removal can't shift the layout underneath. */
  html:has(dialog.dialog:modal) {
    overflow: hidden;
    scrollbar-gutter: stable;
  }

  /* -- Density ------------------------------------------------
     data-density on the .dialog root scales the content padding
     (0.75 / 1 / 1.25 of the 1.5rem default); comfortable matches the
     unsized default. Width stays governed by data-size - two axes. */
  .dialog:where([data-density="compact"]) .dialog-content {
    padding: 1rem;
  }
  .dialog:where([data-density="comfortable"]) .dialog-content {
    padding: 1.5rem;
  }
  .dialog:where([data-density="spacious"]) .dialog-content {
    padding: 2rem;
  }

  /* -- Content sections ------------------------------------- */
  .dialog-content {
    padding: 1.5rem;
  }
  .dialog-header {
    margin-bottom: 1rem;
  }
  .dialog-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
    letter-spacing: -0.01em;
  }
  .dialog-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
    line-height: 1.6;
  }
  .dialog-body {
    margin-top: 1rem;
  }
  .dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
}

/* Accessibility: reduced motion removes open/close transitions (REQUIRED
   for all components - AGENTS.md "Accessibility CSS"). */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    dialog.dialog,
    dialog.dialog::backdrop {
      transition: none;
    }
  }
}

/* ── components/dropdown/dropdown.css ── */
/* -- Dropdown component ---------------------------------------- */

@layer components {
  .dropdown-content {
    background-color: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    min-width: 8rem;
    box-shadow:
      0 4px 16px oklch(0 0 0 / 0.12),
      0 0 0 1px var(--border);

    /* -- Anchor positioning ------------------------------------ */
    position: fixed;
    inset: auto;
    top: anchor(bottom);
    left: anchor(left);
    margin: 0;
    margin-top: 4px;
    /* the preferred edge first; when the menu would leave the viewport it
       flips to the trigger's OTHER edge (flip-inline swaps left: anchor(left)
       <-> right: anchor(right)), above the trigger (flip-block), or both */
    position-try-fallbacks:
      flip-inline,
      flip-block,
      flip-block flip-inline;

    /* data-align="end": the menu's end edge lines up with the trigger's end
       (a split button's chevron, an icon trigger at a row's end) instead of
       hanging out past it - and falls back to start-aligned under the
       trigger when there is no room for that (the fallbacks above) */
    &[data-align="end"] {
      left: auto;
      right: anchor(right);
    }

    /* -- Animation --------------------------------------------- */
    opacity: 0;
    transform: scale(0.96) translateY(-0.25rem);
    /* overlay keeps a closing menu in the top layer until its exit
       animation ends - otherwise a closing SUBMENU drops back into its
       parent menu for 150ms, where the parent's transform makes it the
       containing block: the parent grew scrollbars and resized */
    transition:
      opacity 150ms ease,
      transform 150ms ease,
      overlay 150ms allow-discrete,
      display 150ms allow-discrete;
    /* a menu never scrolls sideways; submenus live in the top layer */
    overflow-x: hidden;

    &:popover-open {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  @starting-style {
    .dropdown-content:popover-open {
      opacity: 0;
      transform: scale(0.96) translateY(-0.25rem);
    }
  }

  .dropdown-item {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border-radius: calc(var(--radius) * 0.6);
    font-size: 0.875rem;
    border: none;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    outline: none;
    text-align: start;
    text-decoration: none;
    font: inherit;
    font-size: 0.875rem;

    &:hover,
    &[data-highlighted] {
      background-color: var(--accent);
      color: var(--accent-foreground);
    }

    &[data-variant="destructive"] {
      &:hover,
      &[data-highlighted] {
        background-color: var(--destructive);
        color: var(--destructive-foreground);
      }
    }

    &:disabled,
    &[aria-disabled="true"] {
      pointer-events: none;
      opacity: 0.5;
    }

    /* data-inset: lines a plain item (or a label) up with the text of
       checkbox / radio items */
    &[data-inset] {
      padding-inline-start: 1.5rem;
    }
    & > svg {
      width: 1rem;
      height: 1rem;
      flex-shrink: 0;
      color: var(--muted-foreground);
    }
    &[data-variant="destructive"] > svg {
      color: currentColor;
    }
  }
  .dropdown-label[data-inset] {
    padding-inline-start: 1.5rem;
  }

  /* -- Submenus ----------------------------------------------------
     <div class="dropdown-sub">
       <button class="dropdown-item dropdown-sub-trigger" role="menuitem">…</button>
       <div class="dropdown-content dropdown-sub-content" role="menu" popover>…</div>
     </div>
     The submenu is a DOM descendant of its menu, so the Popover API keeps
     the parent open while it shows, closes open siblings and light-dismisses
     the whole tree - any depth. It opens beside its trigger (flipping to
     the other side, or up, when there is no room); dropdown.js anchors it. */
  .dropdown-sub {
    display: contents;
  }
  .dropdown-sub-trigger {
    &::after {
      content: "";
      width: 1rem;
      height: 1rem;
      margin-inline-start: auto;
      flex-shrink: 0;
      background-color: currentColor;
      opacity: 0.6;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")
        center / contain no-repeat;
    }
    &:dir(rtl)::after {
      scale: -1 1;
    }
    /* the shortcut sits before the chevron */
    & .dropdown-shortcut {
      margin-inline-start: auto;
    }
    &:has(.dropdown-shortcut)::after {
      margin-inline-start: 0.5rem;
    }
    &[aria-expanded="true"] {
      background-color: var(--accent);
      color: var(--accent-foreground);
    }
  }
  .dropdown-content.dropdown-sub-content {
    top: anchor(top);
    left: anchor(right);
    margin: 0;
    margin-block-start: calc(-0.25rem - 1px);
    margin-inline-start: 0.125rem;
    position-try-fallbacks:
      flip-inline,
      flip-block,
      flip-block flip-inline;
    transform: scale(0.96) translateX(-0.25rem);

    &:popover-open {
      transform: none;
    }
    &:dir(rtl) {
      left: auto;
      right: anchor(left);
    }
  }
  @starting-style {
    .dropdown-content.dropdown-sub-content:popover-open {
      opacity: 0;
      transform: scale(0.96) translateX(-0.25rem);
    }
  }

  /* -- Checkbox / Radio indicators ----------------------------- */
  .dropdown-check,
  .dropdown-radio {
    padding-inline-start: 1.5rem;
    position: relative;

    &::before {
      content: "";
      position: absolute;
      inset-inline-start: 0.375rem;
      top: 50%;
      transform: translateY(-50%);
      width: 0.875rem;
      height: 0.875rem;
    }
  }

  /* Mask (not background-image): a data: URI SVG resolves currentColor to
     BLACK when used as an image, making the checks invisible in dark mode.
     Masking paints them with background-color: currentColor instead. */
  .dropdown-check[aria-checked="true"]::before,
  .dropdown-radio[aria-checked="true"]::before {
    background-color: currentColor;
  }

  .dropdown-check[aria-checked="true"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  }

  .dropdown-radio[aria-checked="true"]::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3C/svg%3E");
  }

  .dropdown-check[aria-checked="true"]::before,
  .dropdown-radio[aria-checked="true"]::before {
    mask-size: contain;
    mask-repeat: no-repeat;
  }

  .dropdown-separator {
    height: 1px;
    background: var(--border);
    margin: 0.25rem -0.25rem;
  }

  .dropdown-label {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted-foreground);
  }

  .dropdown-shortcut {
    margin-inline-start: auto;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    letter-spacing: 0.05em;
  }
  /* one highlighted item: a menu that opens under a resting pointer has the item under it hovered and its first item
     highlighted - the highlight (keys and mouse move it) wins, the hovered one stays plain until the pointer moves */
  .dropdown-content:has([data-highlighted]) .dropdown-item:hover:not([data-highlighted], :focus-visible, :disabled) {
    background-color: transparent;
    color: inherit;
  }
  /* on a destructive highlight the shortcut follows the item's foreground
     (muted grey on red was unreadable) */
  .dropdown-item[data-variant="destructive"]:is(:hover, [data-highlighted]) .dropdown-shortcut {
    color: inherit;
    opacity: 0.8;
  }

  /* -- Sizes ----------------------------------------------------
     data-size goes on the .dropdown-content popover; items, labels,
     shortcuts and the check indicators scale together. md == the unsized
     default. The [data-size] compound outranks the single-class item
     rules; it only touches block padding/font so the check/radio inline
     padding (padding-inline-start) keeps working. */
  .dropdown-content[data-size="xs"] {
    & .dropdown-item {
      padding-block: 0.1875rem;
      font-size: 0.75rem;
    }
    & .dropdown-label {
      padding-block: 0.1875rem;
      font-size: 0.6875rem;
    }
    & .dropdown-shortcut {
      font-size: 0.6875rem;
    }
    & :is(.dropdown-check, .dropdown-radio)::before {
      width: 0.75rem;
      height: 0.75rem;
    }
  }
  .dropdown-content[data-size="sm"] {
    & .dropdown-item {
      padding-block: 0.25rem;
      font-size: 0.8125rem;
    }
    & .dropdown-shortcut {
      font-size: 0.75rem;
    }
  }
  .dropdown-content[data-size="md"] {
    & .dropdown-item {
      padding-block: 0.375rem;
      font-size: 0.875rem;
    }
  }
  .dropdown-content[data-size="lg"] {
    & .dropdown-item {
      padding-block: 0.5rem;
      font-size: 1rem;
    }
    & .dropdown-label {
      font-size: 0.8125rem;
    }
    & .dropdown-shortcut {
      font-size: 0.875rem;
    }
  }
  .dropdown-content[data-size="xl"] {
    & .dropdown-item {
      padding-block: 0.625rem;
      font-size: 1.125rem;
    }
    & .dropdown-label {
      font-size: 0.875rem;
    }
    & .dropdown-shortcut {
      font-size: 1rem;
    }
  }

  /* -- Accessibility ------------------------------------------ */

  @media (prefers-reduced-motion: reduce) {
    .dropdown-content {
      transition: none;
    }
    .dropdown-item {
      transition: none;
    }
  }

  @media (forced-colors: active) {
    .dropdown-content {
      border-color: ButtonText;
    }
    .dropdown-item {
      &:hover,
      &[data-highlighted] {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
      }
    }
  }
}

/* ── components/file-input/file-input.css ── */
/* -- File Input component --------------------------------------- */

@layer components {
  .file-input {
    /* see .input - border-box so the declared ladder height is the real box;
       unsized default = the ladder's md step (field standard) */
    box-sizing: border-box;
    width: 100%;
    /* the chosen file name is the whole point of the control's text part -
       never let a flex/grid row squeeze it below a readable path length */
    min-inline-size: min(100%, 24rem);
    height: 2.25rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--foreground);
    outline: none;
    box-shadow: var(--shadow-xs);
    transition:
      border-color 150ms,
      box-shadow 150ms;
    padding: 0;
    cursor: pointer;

    &::file-selector-button {
      /* % resolves against the border-box's CONTENT height once the control is
         border-box - 100% would leave 1px gaps above/below the divider; +2px
         makes the button flush with the frame (its original visual) */
      height: calc(100% + 2px);
      border: none;
      border-right: 1px solid var(--input);
      background: var(--muted);
      color: var(--foreground);
      font-size: 0.875rem;
      font-weight: 500;
      font-family: var(--font-sans);
      padding: 0 0.75rem;
      margin-right: 0.75rem;
      cursor: pointer;
      transition: background 150ms;

      &:hover {
        background: var(--accent);
      }
    }

    &:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    /* Disabled = legible but inert: muted surface + text inside the
       full-strength border - never an opacity fade */
    &:disabled {
      background-color: var(--muted);
      color: var(--muted-foreground);
      box-shadow: none;
      cursor: not-allowed;

      &::file-selector-button {
        color: var(--muted-foreground);
        cursor: not-allowed;

        &:hover {
          background: var(--muted);
        }
      }
    }

    /* -- Sizes: same ladder as .input/.date-input (md = 2.25rem; the
       unsized default keeps the historical 2.5rem). The file-selector
       button fills the container (height:100%), so only the box and the
       font scale. */
    &[data-size="xs"] {
      height: 1.75rem;
      font-size: 0.75rem;
      &::file-selector-button {
        padding: 0 0.5rem;
        margin-right: 0.5rem;
        font-size: 0.75rem;
      }
    }
    &[data-size="sm"] {
      height: 2rem;
      font-size: 0.8125rem;
      &::file-selector-button {
        padding: 0 0.625rem;
        margin-right: 0.625rem;
        font-size: 0.8125rem;
      }
    }
    &[data-size="md"] {
      height: 2.25rem;
      font-size: 0.875rem;
    }
    &[data-size="lg"] {
      height: 2.75rem;
      font-size: 1rem;
      &::file-selector-button {
        padding: 0 1rem;
        margin-right: 1rem;
        font-size: 1rem;
      }
    }
    &[data-size="xl"] {
      height: 3.25rem;
      font-size: 1.125rem;
      &::file-selector-button {
        padding: 0 1.25rem;
        margin-right: 1.25rem;
        font-size: 1.125rem;
      }
    }
  }

  /* -- Drop zone ---------------------------------------------------------
     .file-drop wraps a <label class="file-drop-zone"> (the card) whose
     native <input type="file" class="file-drop-input"> covers it,
     invisible - so a click opens the picker and a DROP lands on the input
     itself: the browser fills input.files natively, no JavaScript needed.
     file-input.js adds the drag highlight, filters dropped files by
     accept / data-max-size / data-max-files (the browser does not filter
     drops), appends to the selection instead of replacing it, and lists the
     files in .file-drop-list with previews and remove buttons. */
  .file-drop {
    display: grid;
    gap: 0.75rem;
    width: 100%;
  }
  .file-drop-zone {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.375rem;
    padding: 2rem 1.5rem;
    border: 2px dashed color-mix(in oklch, var(--foreground) 22%, transparent);
    border-radius: var(--radius-xl);
    background-color: var(--card);
    color: var(--card-foreground);
    text-align: center;
    cursor: pointer;
    transition:
      border-color 150ms ease,
      background-color 150ms ease,
      scale 150ms ease;

    &:hover {
      border-color: color-mix(in oklch, var(--foreground) 40%, transparent);
    }
    &:has(.file-drop-input:focus-visible) {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }
    &:has(.file-drop-input:disabled) {
      opacity: 0.55;
      cursor: not-allowed;
    }
  }
  .file-drop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: inherit;
    font-size: 0; /* no native "No file chosen" hit-box quirks */
  }
  .file-drop-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.25rem;
    border-radius: 9999px;
    background-color: var(--muted);
    color: var(--muted-foreground);
    font-size: 1.5rem;
    line-height: 1;
    transition:
      background-color 150ms ease,
      color 150ms ease,
      translate 150ms ease;

    & svg {
      width: 1.5rem;
      height: 1.5rem;
    }
  }
  .file-drop-title {
    font-size: 0.9375rem;
    font-weight: 600;
    text-wrap: balance;

    & u,
    & .file-drop-browse {
      color: var(--primary);
      text-decoration: underline;
      text-underline-offset: 3px;
    }
  }
  .file-drop-hint {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-wrap: balance;
  }

  /* dragging files over the zone */
  .file-drop[data-state-name="dragover"] .file-drop-zone {
    border-color: var(--primary);
    border-style: solid;
    background-color: color-mix(in oklch, var(--primary) 6%, var(--card));
    scale: 1.01;

    & .file-drop-icon {
      background-color: var(--primary);
      color: var(--primary-foreground);
      translate: 0 -2px;
    }
  }
  /* rejected files (wrong type, too big, too many) */
  .file-drop[data-state-name="error"] .file-drop-zone {
    border-color: var(--destructive);
  }
  .file-drop-error {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--destructive);

    &:empty {
      display: none;
    }
  }

  /* compact: one row - icon, text, and the whole row is the target */
  .file-drop[data-size="sm"] .file-drop-zone {
    grid-template-columns: auto 1fr;
    justify-items: start;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0;
    padding: 0.75rem 1rem;
    text-align: start;
    border-radius: var(--radius-lg);

    & .file-drop-icon {
      grid-row: span 2;
      width: 2.25rem;
      height: 2.25rem;
      margin: 0;
      font-size: 1.125rem;
      & svg {
        width: 1.125rem;
        height: 1.125rem;
      }
    }
  }

  /* -- The file list ---------------------------------------------------- */
  .file-drop-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;

    &:empty {
      display: none;
    }
  }
  .file-drop-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--card);
  }
  .file-drop-thumb {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
  .file-drop-name {
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .file-drop-meta {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted-foreground);
  }
  .file-drop-remove {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;

    &:hover {
      background-color: var(--accent);
      color: var(--accent-foreground);
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 1px;
    }
    & svg {
      width: 1rem;
      height: 1rem;
    }
  }

  @media (forced-colors: active) {
    .file-drop-zone {
      border-color: CanvasText;
    }
    .file-drop[data-state-name="dragover"] .file-drop-zone {
      border-color: Highlight;
    }
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .file-input,
    .file-input *,
    .file-input::before,
    .file-input::after,
    .file-input *::before,
    .file-input *::after,
    .file-input::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/icon/icon.css ── */
/* -- Icon component ---------------------------------------- */
/* Styling for Lucide CDN icons (<i data-lucide="name">).     */
/* Lucide replaces <i> with <svg>, these styles target that.  */

@layer components {
  [data-lucide] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    width: 1rem;
    height: 1rem;
    pointer-events: none;

    /* -- Sizes via data-size --------------------------------- */
    &[data-size="xs"] {
      width: 0.75rem;
      height: 0.75rem;
    }
    &[data-size="sm"] {
      width: 0.875rem;
      height: 0.875rem;
    }
    &[data-size="md"] {
      width: 1.25rem;
      height: 1.25rem;
    }
    &[data-size="lg"] {
      width: 1.5rem;
      height: 1.5rem;
    }
    &[data-size="xl"] {
      width: 2rem;
      height: 2rem;
    }

    /* -- Spin animation ------------------------------------- */
    &[data-animate="spin"] {
      animation: icon-spin 1s linear infinite;
    }
  }

  @keyframes icon-spin {
    to {
      transform: rotate(360deg);
    }
  }

  /* ---- Accessibility ---------------------------------------- */

  @media (prefers-reduced-motion: reduce) {
    [data-lucide] {
      animation: none !important;
      transition: none !important;
    }
  }

  @media (prefers-contrast: more) {
    [data-lucide] {
      stroke-width: 2.5;
    }
  }

  @media (forced-colors: active) {
    [data-lucide] {
      color: CanvasText;
    }
  }
}

/* ── components/input/input.css ── */
/* -- Input component ------------------------------------------- */

@layer components {
  .input {
    /* border-box is load-bearing for the shared field ladder: the UA gives
       <input> content-box, so `height` would otherwise exclude the 2px frame
       and render 2px taller than the border-box fields (select, button-based
       triggers). With it, every declared height IS the rendered box.
       The unsized default IS the ladder's md step (2.25rem = 36px) - same
       height, padding and font as [data-size="md"] below, so an unlabeled
       field and an explicit md field are the same control. */
    box-sizing: border-box;
    height: 2.25rem;
    width: 100%;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--foreground);
    outline: none;
    box-shadow: var(--shadow-xs);
    transition:
      border-color 150ms,
      box-shadow 150ms;

    &:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    &::placeholder {
      color: var(--muted-foreground);
    }

    /* -- Readonly state -------------------------------------- */
    /* :not(:disabled) is load-bearing: a disabled input ALSO matches
       :read-only, and this rule's specificity (class + pseudo + :not attr)
       outranks the plain :disabled below - without the exclusion, disabled
       controls would render with the readonly look (0.7/default). */
    &:read-only:not([type="file"], :disabled) {
      background: var(--muted);
      cursor: default;
      opacity: 0.7;

      &:focus {
        border-color: var(--input);
        box-shadow: var(--shadow-xs);
      }
    }

    /* Disabled = legible but inert: a muted surface and muted text inside
       the full-strength border - never an opacity fade that lets the box
       dissolve into the page. */
    &:disabled {
      background-color: var(--muted);
      color: var(--muted-foreground);
      box-shadow: none;
      cursor: not-allowed;
    }

    /* -- Invalid state --------------------------------------- */
    /* WHEN a field turns red: aria-invalid="true" always (the page decided).
       The browser's own verdict (:user-invalid, i.e. after the user left a
       changed field) only counts inside a <form> - a standalone text box has
       nothing to submit, so a half-typed value is never judged - and inside
       form[data-validate="submit"] only once the page has stamped
       data-submitted on the form (a submit attempt): check when the person
       is finished, not the instant they leave the box. */
    &:is([aria-invalid="true"], :user-invalid:is(form *):not(form[data-validate="submit"]:not([data-submitted]) *)) {
      border-color: var(--destructive);

      &:focus {
        border-color: var(--destructive);
        box-shadow: 0 0 0 2px oklch(from var(--destructive) l c h / 0.2);
      }
    }

    /* -- File input ------------------------------------------ */
    &[type="file"] {
      padding: 0;
      font-size: 0.875rem;

      &::file-selector-button {
        height: 100%;
        border: none;
        border-right: 1px solid var(--input);
        background: var(--muted);
        color: var(--foreground);
        font-size: 0.875rem;
        font-weight: 500;
        font-family: var(--font-sans);
        padding: 0 0.75rem;
        margin-right: 0.75rem;
        cursor: pointer;
        transition: background 150ms;

        &:hover {
          background: var(--accent);
        }
      }
    }

    /* -- Native in-field buttons ------------------------------
       The clear "×" of type="search" and the calendar/clock icon of the
       date/time types are clickable controls INSIDE the text field - without
       this they inherit the field's text cursor and look like more text to
       type into (the file picker's button above already points). */
    &::-webkit-search-cancel-button,
    &::-webkit-calendar-picker-indicator {
      cursor: pointer;
    }

    /* -- Sizes ----------------------------------------------- */
    &[data-size="xs"] {
      height: 1.75rem;
      padding: 0 0.5rem;
      font-size: 0.75rem;
    }
    &[data-size="sm"] {
      height: 2rem;
      padding: 0 0.625rem;
      font-size: 0.8125rem;
    }
    &[data-size="md"] {
      height: 2.25rem;
      padding: 0 0.75rem;
      font-size: 0.875rem;
    }
    &[data-size="lg"] {
      height: 2.75rem;
      padding: 0 1rem;
      font-size: 1rem;
    }
    &[data-size="xl"] {
      height: 3.25rem;
      padding: 0 1.25rem;
      font-size: 1.125rem;
    }
  }

  /* -- Input group: icons, text and buttons inside the field ---
     The GROUP draws the field frame (border, radius, shadow, focus ring,
     invalid / disabled / readonly surfaces); the .input inside goes
     frameless and fills the rest. DOM order is the placement: an addon
     before the .input sits at the start, one after it at the end - so a
     trailing copy / show-password / clear button is just markup after the
     input, and any addon width works without hand-tuned padding. */
  .input-group {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    width: 100%;
    height: 2.25rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    box-shadow: var(--shadow-xs);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    transition:
      border-color 150ms,
      box-shadow 150ms;

    & > .input {
      flex: 1;
      min-width: 0;
      height: 100%;
      border: none;
      border-radius: inherit;
      background: transparent;
      box-shadow: none;
      font-size: inherit;

      &:focus {
        box-shadow: none;
      }
      &:not(:first-child) {
        padding-inline-start: 0.5rem;
      }
      &:not(:last-child) {
        padding-inline-end: 0.5rem;
      }
    }

    &:has(> .input:focus) {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    &:has(
      > .input:is(
        [aria-invalid="true"],
        :user-invalid:is(form *):not(form[data-validate="submit"]:not([data-submitted]) *)
      )
    ) {
      border-color: var(--destructive);

      &:has(> .input:focus) {
        box-shadow: 0 0 0 2px oklch(from var(--destructive) l c h / 0.2);
      }
    }

    /* readonly: the group carries the muted surface (the input's own
       readonly background would stop short of the addons) */
    &:has(> .input:read-only:not(:disabled)) {
      background: var(--muted);

      & > .input {
        background: transparent;
      }
      &:has(> .input:focus) {
        border-color: var(--input);
        box-shadow: var(--shadow-xs);
      }
    }

    &:has(> .input:disabled) {
      background: var(--muted);
      box-shadow: none;
      cursor: not-allowed;

      & > .input {
        background: transparent;
      }
    }

    /* decorative icon (inline <svg> or lucide <i>) */
    & > .input-group-icon {
      flex-shrink: 0;
      width: 1rem;
      height: 1rem;
      color: var(--muted-foreground);
      pointer-events: none;

      &:first-child {
        margin-inline-start: 0.75rem;
      }
      &:last-child {
        margin-inline-end: 0.75rem;
      }
    }

    /* static text: a unit, a protocol, a domain */
    & > .input-group-text {
      flex-shrink: 0;
      white-space: nowrap;
      color: var(--muted-foreground);
      user-select: none;

      &:first-child {
        margin-inline-start: 0.75rem;
      }
      &:last-child {
        margin-inline-end: 0.75rem;
      }
    }

    /* an in-field action: copy, show/hide, clear, open a picker */
    & > .input-group-button {
      flex-shrink: 0;
      display: inline-grid;
      place-items: center;
      box-sizing: border-box;
      height: calc(100% - 0.5rem);
      aspect-ratio: 1;
      padding: 0;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--muted-foreground);
      cursor: pointer;
      transition:
        background-color 150ms,
        color 150ms;

      & svg {
        width: 1rem;
        height: 1rem;
      }
      /* icon swaps (copy -> check, eye -> eye-off): the UA's [hidden] rule
         only covers HTML elements, so a hidden <svg> needs its own */
      & svg[hidden] {
        display: none;
      }
      &:hover {
        background: var(--accent);
        color: var(--accent-foreground);
      }
      &:focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 1px;
      }
      &:disabled {
        cursor: not-allowed;
        background: transparent;
        color: var(--muted-foreground);
      }
      &:first-child {
        margin-inline-start: 0.25rem;
      }
      &:last-child {
        margin-inline-end: 0.25rem;
      }
      & + .input-group-button {
        margin-inline-start: 0.125rem;
      }
    }

    /* -- Sizes: the same ladder as .input, set on the group ------ */
    &[data-size="xs"] {
      height: 1.75rem;
      font-size: 0.75rem;
    }
    &[data-size="sm"] {
      height: 2rem;
      font-size: 0.8125rem;
    }
    &[data-size="md"] {
      height: 2.25rem;
      font-size: 0.875rem;
    }
    &[data-size="lg"] {
      height: 2.75rem;
      font-size: 1rem;
    }
    &[data-size="xl"] {
      height: 3.25rem;
      font-size: 1.125rem;
    }
  }

  /* -- Auto-growing textarea --------------------------------- */
  textarea.input {
    field-sizing: content;
    min-height: 5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  /* -- Field description ------------------------------------- */
  .field-description {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin: 0.375rem 0 0;
  }

  /* -- Field error ------------------------------------------- */
  .field-error {
    font-size: 0.8125rem;
    color: var(--destructive);
    margin: 0.375rem 0 0;
  }

  /* -- Accessibility ---------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .input {
      transition: none;
    }

    .input[type="file"]::file-selector-button {
      transition: none;
    }
  }

  @media (prefers-contrast: more) {
    .input {
      border-width: 2px;
    }

    .input:disabled {
      border-color: var(--muted-foreground);
    }
  }

  @media (forced-colors: active) {
    .input {
      border-color: ButtonBorder;
      color: ButtonText;
      background: Field;
    }

    .input:focus {
      outline: 2px solid Highlight;
      outline-offset: 1px;
    }

    .input:disabled {
      opacity: 1;
      color: GrayText;
      border-color: GrayText;
    }

    .input:is(
      [aria-invalid="true"],
      :user-invalid:is(form *):not(form[data-validate="submit"]:not([data-submitted]) *)
    ) {
      border-color: LinkText;
    }

    .field-error {
      color: LinkText;
    }

    .input-group {
      border-color: ButtonBorder;
      background: Field;

      & > .input:focus {
        outline: none;
      }
      &:has(> .input:focus) {
        outline: 2px solid Highlight;
        outline-offset: 1px;
      }
      &:has(> .input:disabled) {
        border-color: GrayText;
      }
      & > .input-group-button {
        color: ButtonText;
      }
    }
  }
}

/* ── components/label/label.css ── */
/* -- Label component -------------------------------------------- */

@layer components {
  .label {
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    line-height: 1;
    color: var(--foreground);
    display: block;
    margin-bottom: 0.375rem;
    cursor: default;

    /* Required - the adjacent control carries `required`: render the star.
       Pure CSS (no span to remember, nothing to desync); decorative only —
       the native attribute already conveys the requirement to AT. */
    &:has(+ input[required])::after,
    &:has(+ textarea[required])::after {
      content: " \00a0*";
      color: var(--destructive);
      font-weight: 600;
    }

    /* Disabled - explicit attribute */
    &[data-disabled] {
      opacity: 0.7;
      cursor: not-allowed;
    }

    /* Disabled - auto-detect via adjacent disabled control */
    &:has(+ :disabled),
    &:has(+ [data-disabled]) {
      opacity: 0.7;
      cursor: not-allowed;
    }
  }

  /* -- Hint text (optional, required indicators) ----------- */
  .label-hint {
    font-weight: 400;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
  }

  /* -- Accessibility ---------------------------------------- */
  @media (prefers-contrast: more) {
    .label[data-disabled],
    .label:has(+ :disabled),
    .label:has(+ [data-disabled]) {
      opacity: 0.85;
    }
  }

  @media (forced-colors: active) {
    .label {
      color: LinkText;
    }

    .label[data-disabled],
    .label:has(+ :disabled),
    .label:has(+ [data-disabled]) {
      opacity: 1;
      color: GrayText;
    }
  }
}

/* ── components/language-switcher/language-switcher.css ── */
/* -- Language Switcher component -------------------------------------
   The runtime writes a shipped Combobox (a Swap, or radio items for a
   Dropdown Menu) into the element; these
   rules size it to its content and draw the flags. A flag is the language's
   code (::before) under its SVG (::after): a flag that fails to load leaves
   the code readable. Shape, scale and finish are attributes on the root. */

@layer components {
  .language-switcher {
    --language-switcher-flag-height: 1rem;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;

    /* -- Flag scale ----------------------------------------------- */
    &[data-flag-size="xs"] {
      --language-switcher-flag-height: 0.75rem;
    }
    &[data-flag-size="sm"] {
      --language-switcher-flag-height: 0.875rem;
    }
    &[data-flag-size="lg"] {
      --language-switcher-flag-height: 1.25rem;
    }
    &[data-flag-size="xl"] {
      --language-switcher-flag-height: 1.75rem;
    }

    /* -- Flag shapes ---------------------------------------------- */
    &[data-flag-shape="rounded"] .language-switcher-flag {
      border-radius: calc(var(--language-switcher-flag-height) * 0.25);
    }
    &[data-flag-shape="square"] .language-switcher-flag {
      inline-size: var(--language-switcher-flag-height);
    }
    &[data-flag-shape="squircle"] .language-switcher-flag {
      inline-size: var(--language-switcher-flag-height);
      border-radius: 32%;
    }
    &[data-flag-shape="circle"] .language-switcher-flag {
      inline-size: var(--language-switcher-flag-height);
      border-radius: 50%;
    }

    /* -- Flag finishes -------------------------------------------- */
    &[data-flag-style="ring"] .language-switcher-flag {
      outline: 1px solid color-mix(in oklch, var(--foreground) 22%, transparent);
      outline-offset: -1px;
    }
    &[data-flag-style="shadow"] .language-switcher-flag {
      box-shadow:
        0 0 0 1px var(--border),
        var(--shadow-sm);
    }
    &[data-flag-style="glossy"] .language-switcher-flag {
      --language-switcher-gloss: linear-gradient(
        160deg,
        oklch(1 0 0 / 0.55),
        oklch(1 0 0 / 0) 42%,
        oklch(0 0 0 / 0) 58%,
        oklch(0 0 0 / 0.2)
      );
      outline: 1px solid oklch(0 0 0 / 0.12);
      outline-offset: -1px;
    }

    /* the code shown instead of a name (a condensed footer, a toolbar) */
    &[data-display="code"] .language-switcher-label {
      font-family: var(--font-mono);
      font-size: 0.75rem;
      letter-spacing: 0.04em;
    }
  }

  .language-switcher-flag {
    position: relative;
    display: inline-block;
    flex: none;
    inline-size: calc(var(--language-switcher-flag-height) * 4 / 3);
    block-size: var(--language-switcher-flag-height);
    border-radius: 2px;
    overflow: hidden;
    background-color: var(--muted);
    transition: scale 150ms ease;

    &::before {
      content: attr(data-code);
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-family: var(--font-mono);
      font-size: calc(var(--language-switcher-flag-height) * 0.5);
      font-weight: 600;
      line-height: 1;
      color: var(--muted-foreground);
    }

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      background-image: var(--language-switcher-gloss, none), var(--language-switcher-flag, none);
      background-position: center;
      background-size: cover;
      background-repeat: no-repeat;
    }

    /* a flag in the dark is a little dimmer, so it does not glare beside the text */
    :where(.dark) &::after {
      filter: brightness(0.92) saturate(0.95);
    }
  }

  .language-switcher-icon {
    flex: none;
    width: 1rem;
    height: 1rem;
  }

  .language-switcher-label {
    white-space: nowrap;
  }

  /* -- The Combobox face ------------------------------------------ */
  .language-switcher-combobox {
    display: inline-block;

    & .combobox-trigger {
      width: auto;
      justify-content: flex-start;
      gap: 0.5rem;
    }

    & .combobox-value {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      flex: none;
      font-weight: 500;
    }

    /* a language is always chosen: no clear button, the chevron stays */
    & .combobox-clear {
      display: none !important;
    }
    &.combobox:has(.combobox-value) .combobox-trigger > .combobox-chevron {
      display: block;
    }

    & .combobox-content {
      width: max-content;
      min-width: max(anchor-size(width), 13rem);
      max-width: min(22rem, calc(100vw - 1rem));
      position-try-fallbacks:
        flip-inline,
        flip-block,
        flip-block flip-inline;
    }

    /* a short list needs no search box; it stays for the keys (arrows, Enter) */
    & .combobox-search[data-quiet] {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      border: 0;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }

  /* the list opens toward the start edge where the switcher sits at the end (a header's right side) */
  .language-switcher[data-align="end"] .combobox-content {
    left: auto;
    right: anchor(right);
  }

  .language-switcher-option {
    gap: 0.625rem;

    &[data-highlighted] .language-switcher-flag,
    &:hover .language-switcher-flag {
      scale: 1.08;
    }
  }

  .language-switcher-name {
    white-space: nowrap;
  }

  .language-switcher-alt {
    margin-inline-start: auto;
    padding-inline-start: 1rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    white-space: nowrap;

    &[hidden] {
      display: none;
    }
    .language-switcher-option[data-highlighted] &,
    .language-switcher-option:hover & {
      color: inherit;
      opacity: 0.75;
    }
  }

  /* -- The Menu face: radio items in a Dropdown Menu ----------------- */
  .language-switcher[data-variant="menu"] {
    display: block;
  }
  .language-switcher-menu {
    display: contents;
  }
  .language-switcher-item {
    gap: 0.625rem;

    &[data-highlighted] .language-switcher-flag,
    &:hover .language-switcher-flag {
      scale: 1.08;
    }
    & .language-switcher-alt {
      color: var(--muted-foreground);
    }
  }

  /* -- The Swap face ---------------------------------------------- */
  .language-switcher-swap {
    & .swap-on,
    & .swap-off {
      gap: 0.375rem;
      padding-inline: 0.375rem;
    }
    & .language-switcher-label {
      font-weight: 500;
    }
  }

  /* -- Accessibility ---------------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .language-switcher-flag {
      transition: none;
    }
    :is(.language-switcher-option, .language-switcher-item) .language-switcher-flag {
      scale: none !important;
    }
  }

  @media (prefers-contrast: more) {
    .language-switcher-flag {
      outline: 1px solid var(--foreground);
      outline-offset: -1px;
    }
    .language-switcher-alt {
      color: var(--foreground);
    }
  }

  @media (forced-colors: active) {
    /* the flag keeps its own colors; a system-color frame marks its edge */
    .language-switcher-flag {
      forced-color-adjust: none;
      outline: 1px solid CanvasText;
      outline-offset: -1px;
    }
  }
}

/* ── components/marker/marker.css ── */
/* -- Marker component ------------------------------------------------ */
/* An inline status, system note, bordered row or labeled separator in a
   conversation ("Explored 4 files", "Today", "Conversation compacted").
   CSS only; a spinner / icon goes in .marker-icon, the words in
   .marker-content. */

@layer components {
  .marker {
    --_ic: currentColor;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    padding-block: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--muted-foreground);
    text-align: start;

    /* -- Variants -------------------------------------------------- */
    /* border: a full-width row with a rule under it */
    &[data-variant="border"] {
      width: 100%;
      padding-block: 0.5rem;
      border-block-end: 1px solid var(--border);
    }
    /* separator: a centered label between two rules ("Today") */
    &[data-variant="separator"] {
      width: 100%;
      justify-content: center;
      gap: 0.75rem;
      font-size: 0.75rem;
      font-weight: 500;

      &::before,
      &::after {
        content: "";
        flex: 1 1 0;
        min-width: 1rem;
        height: 1px;
        background: var(--border);
      }
    }

    /* stacked: the icon above the words, centered */
    &[data-orientation="vertical"] {
      flex-direction: column;
      gap: 0.375rem;
      text-align: center;
      &:not([data-variant="separator"], [data-variant="border"]) {
        margin-inline: auto;
      }
    }

    /* -- Tones: color the icon (the words stay quiet) -------------- */
    &[data-tone="success"] {
      --_ic: oklch(0.6 0.15 150);
    }
    &[data-tone="warning"] {
      --_ic: oklch(0.72 0.16 70);
    }
    &[data-tone="info"] {
      --_ic: oklch(0.6 0.16 250);
    }
    &[data-tone="destructive"] {
      --_ic: var(--destructive);
    }
    &[data-tone="primary"] {
      --_ic: var(--primary);
    }

    /* -- Sizes ------------------------------------------------------ */
    &[data-size="sm"] {
      font-size: 0.75rem;
      gap: 0.375rem;
      & .marker-icon {
        font-size: 0.875rem;
      }
    }
    &[data-size="lg"] {
      font-size: 0.875rem;
      & .marker-icon {
        font-size: 1.125rem;
      }
    }
  }

  .marker-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: var(--_ic);

    & svg {
      width: 1em;
      height: 1em;
    }
  }

  .marker-content {
    min-width: 0;
    text-wrap: pretty;
    overflow-wrap: anywhere;

    & strong,
    & b {
      font-weight: 600;
      color: var(--foreground);
    }
    & code {
      font-family: var(--font-mono);
      font-size: 0.92em;
      color: var(--foreground);
    }
  }

  /* -- Shimmer: streaming text ("Thinking…") - a light band sweeps
     across the words (background-clip: text) ------------------------ */
  .marker-content[data-shimmer] {
    color: transparent;
    background: linear-gradient(
        90deg,
        var(--muted-foreground) 0%,
        var(--muted-foreground) 35%,
        var(--foreground) 50%,
        var(--muted-foreground) 65%,
        var(--muted-foreground) 100%
      )
      0 0 / 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: marker-shimmer 1.8s linear infinite;
  }
  @keyframes marker-shimmer {
    from {
      background-position: 100% 0;
    }
    to {
      background-position: 0% 0;
    }
  }

  /* -- Interactive: the whole marker as a link or a button ----------- */
  :is(a, button).marker {
    appearance: none;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-decoration: none;
    cursor: pointer;
    transition: color 150ms ease;

    &:hover {
      color: var(--foreground);
      & .marker-content {
        text-decoration: underline;
        text-underline-offset: 2px;
      }
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }
    &:disabled {
      opacity: 0.5;
      pointer-events: none;
    }
  }
  :is(a, button).marker[data-variant="border"] {
    border-radius: 0;
    border-block-end: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .marker-content[data-shimmer] {
      animation: none;
      color: var(--muted-foreground);
      background: none;
    }
    :is(a, button).marker {
      transition: none;
    }
  }
}

@media (prefers-contrast: more) {
  @layer components {
    .marker {
      color: var(--foreground);
    }
    .marker[data-variant="separator"]::before,
    .marker[data-variant="separator"]::after {
      background: var(--foreground);
    }
  }
}

@media (forced-colors: active) {
  @layer components {
    .marker {
      color: CanvasText;
    }
    .marker-icon {
      color: CanvasText;
    }
    .marker[data-variant="separator"]::before,
    .marker[data-variant="separator"]::after {
      background: CanvasText;
    }
    .marker-content[data-shimmer] {
      color: CanvasText;
      background: none;
    }
    :is(a, button).marker {
      color: LinkText;
    }
  }
}

/* ── components/message/message.css ── */
/* -- Message component ----------------------------------------------- */
/* One row of a conversation: an avatar beside a column of header (name,
   time), the message surface (a .bubble, an attachment, anything) and a
   footer (status, actions). Start = the other side, end = you. CSS only. */

@layer components {
  .message {
    --_av: 2rem;
    --_gap: 0.5rem;
    --_foot: 1.75rem;
    display: flex;
    align-items: flex-end;
    gap: var(--_gap);
    width: 100%;
    min-width: 0;

    &[data-align="end"] {
      flex-direction: row-reverse;
    }

    /* -- Sizes: avatar column and the text scale ------------------- */
    &[data-size="sm"] {
      --_av: 1.5rem;
      --_gap: 0.375rem;
    }
    &[data-size="lg"] {
      --_av: 2.5rem;
      --_gap: 0.75rem;
    }
  }

  /* The avatar slot keeps its column even when empty (a placeholder keeps
     consecutive messages aligned) and sits level with the surface's
     bottom edge - lifted above the footer when there is one. */
  .message-avatar {
    display: flex;
    flex: none;
    justify-content: center;
    width: var(--_av);

    & > .avatar {
      width: var(--_av);
      height: var(--_av);
    }
  }
  .message:has(> .message-content > .message-footer) > .message-avatar {
    margin-block-end: calc(var(--_foot) + 0.125rem);
  }
  /* no avatar column at all: data-avatar="none" on the message */
  .message[data-avatar="none"] > .message-avatar {
    display: none;
  }

  .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    min-width: 0;
    max-width: min(80%, 40rem);

    /* the surface fills up to the column; the column carries the 80% cap */
    & > .bubble {
      max-width: 100%;
    }
    & > .bubble[data-variant="ghost"] {
      width: auto;
    }
  }
  .message[data-align="end"] > .message-content {
    align-items: flex-end;
  }
  /* an assistant's ghost reply runs the full width */
  .message-content:has(> .bubble[data-variant="ghost"]) {
    max-width: 100%;
    flex: 1;
  }
  /* its header lines up with the unframed text */
  .message-content:has(> .bubble[data-variant="ghost"]) > :is(.message-header, .message-footer) {
    padding-inline: 0;
  }

  .message-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding-inline: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted-foreground);
  }
  .message-name {
    font-weight: 600;
    color: var(--foreground);
  }
  .message-time {
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);
  }

  .message-footer {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: var(--_foot);
    padding-inline: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    white-space: nowrap;

    & svg {
      width: 0.875rem;
      height: 0.875rem;
      flex-shrink: 0;
    }
    & .btn svg {
      width: 1rem;
      height: 1rem;
    }
    & .btn {
      color: var(--muted-foreground);
    }
    & .btn:hover {
      color: var(--foreground);
    }
  }

  /* data-reveal="hover": the footer's actions appear on hover / focus of
     the message; always shown where there is no hover (touch) */
  @media (hover: hover) {
    .message-footer[data-reveal="hover"] {
      opacity: 0;
      transition: opacity 150ms ease;
    }
    .message:is(:hover, :focus-within) > .message-content > .message-footer[data-reveal="hover"] {
      opacity: 1;
    }
  }

  /* -- Status: delivery ticks in the footer --------------------------- */
  .message-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    &[data-status="read"] {
      color: oklch(0.6 0.16 250);
    }
    &[data-status="failed"] {
      color: var(--destructive);
    }
  }

  /* -- Attachment: a file card as the message surface ------------------ */
  .message-attachment {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 16rem;
    max-width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--card-foreground);
    font-size: 0.8125rem;
    text-decoration: none;

    &:is(a) {
      cursor: pointer;
      transition: background-color 150ms ease;
    }
    &:is(a):hover {
      background: var(--accent);
    }
    &:is(a):focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }
  }
  .message-attachment-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--muted-foreground);
    & svg {
      width: 1.125rem;
      height: 1.125rem;
    }
  }
  .message-attachment-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
  }
  .message-attachment-name {
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .message-attachment-meta {
    font-size: 0.75rem;
    color: var(--muted-foreground);
  }

  /* -- Group: consecutive messages of one sender ---------------------- */
  .message-group {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;

    /* one avatar per group: only the last message shows it (the others
       keep the empty column, so everything lines up) */
    & > .message:not(:last-child) > .message-avatar > * {
      visibility: hidden;
    }
    /* one header per group: the first message's */
    & > .message:not(:first-child) > .message-content > .message-header {
      display: none;
    }
    /* the joined bubble corners tighten, as in a .bubble-group */
    & > .message:not([data-align="end"]) {
      &:not(:last-child) > .message-content > .bubble > .bubble-content {
        border-end-start-radius: var(--_rs);
      }
      &:not(:first-child) > .message-content > .bubble > .bubble-content {
        border-start-start-radius: var(--_rs);
      }
    }
    & > .message[data-align="end"] {
      &:not(:last-child) > .message-content > .bubble > .bubble-content {
        border-end-end-radius: var(--_rs);
      }
      &:not(:first-child) > .message-content > .bubble > .bubble-content {
        border-start-end-radius: var(--_rs);
      }
    }
  }

  /* -- A conversation: rows of messages, groups and markers ------------- */
  .message-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .message-footer[data-reveal="hover"],
    .message-attachment {
      transition: none;
    }
  }
}

@media (prefers-contrast: more) {
  @layer components {
    .message-header,
    .message-footer,
    .message-time,
    .message-attachment-meta {
      color: var(--foreground);
    }
  }
}

@media (forced-colors: active) {
  @layer components {
    .message-attachment {
      border-color: CanvasText;
    }
    .message-status[data-status] {
      color: CanvasText;
    }
  }
}

/* ── components/mockup-code/mockup-code.css ── */
/* -- Mockup Code component --------------------------------------------- */
/* A terminal / code window: a stack of <pre> lines under window chrome.
   Prompts, line numbers and the cursor are CSS-generated, so selecting and
   copying the text never picks them up. CSS only. */

@layer components {
  .mockup-code {
    /* surface + the line tones, retuned per variant for its contrast */
    --_bg: oklch(0.21 0.006 286);
    --_fg: oklch(0.94 0 0);
    --_dim: oklch(0.68 0.01 286);
    --_success: oklch(0.8 0.16 150);
    --_warning: oklch(0.84 0.15 80);
    --_info: oklch(0.76 0.13 245);
    --_destructive: oklch(0.72 0.18 25);
    --_px: 1.25rem;

    position: relative;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding-block: 1.25rem 1rem;
    border-radius: var(--radius-xl);
    background: var(--_bg);
    color: var(--_fg);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    /* code shows what is typed: no => → ⇒ or <!-- → arrow ligatures */
    font-variant-ligatures: none;
    text-align: start;
    /* code reads left to right even inside an RTL page */
    direction: ltr;
    unicode-bidi: isolate;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    /* one column as wide as the longest line (at least the window): every
       line - and its highlight band - spans the same width while the
       window scrolls sideways */
    display: grid;
    grid-template-columns: minmax(100%, max-content);

    /* -- Window chrome: three dots; data-chrome="mac" colours them,
       data-chrome="none" drops the bar ---------------------------- */
    &::before {
      content: "";
      display: block;
      width: 0.75rem;
      height: 0.75rem;
      margin-inline-start: var(--_px);
      margin-block-end: 1rem;
      border-radius: 9999px;
      color: var(--_dim);
      background: currentColor;
      opacity: 0.45;
      box-shadow:
        1.25rem 0 0 currentColor,
        2.5rem 0 0 currentColor;
    }
    &[data-chrome="mac"]::before {
      opacity: 1;
      background: oklch(0.68 0.2 25);
      box-shadow:
        1.25rem 0 0 oklch(0.82 0.16 85),
        2.5rem 0 0 oklch(0.74 0.17 145);
    }
    &[data-chrome="none"] {
      padding-block-start: 1rem;
    }
    &[data-chrome="none"]::before {
      display: none;
    }

    /* -- A title in the bar: data-title="bash - 80x24" -------------- */
    &[data-title]:not([data-chrome="none"])::after {
      content: attr(data-title);
      position: absolute;
      inset-block-start: 0.75rem;
      inset-inline: 4.5rem;
      font-family: var(--font-sans);
      font-size: 0.75rem;
      line-height: 1.25rem;
      text-align: center;
      color: var(--_dim);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      pointer-events: none;
    }

    /* -- Lines -------------------------------------------------- */
    & > pre {
      box-sizing: border-box;
      margin: 0;
      padding: 0 var(--_px);
      border: 0;
      border-radius: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      white-space: pre;
    }
    & > pre > code {
      padding: 0;
      border: 0;
      background: none;
      color: inherit;
      font: inherit;
    }

    /* the prompt: $, >, ~, a number - generated, never selected or copied */
    & > pre[data-prefix]::before,
    &[data-numbers] > pre::before {
      display: inline-block;
      width: 2ch;
      margin-inline-end: 1.25ch;
      text-align: end;
      color: var(--_dim);
      user-select: none;
    }
    & > pre[data-prefix]::before {
      content: attr(data-prefix);
    }

    /* data-numbers on the window: every line without its own prefix is
       numbered (CSS counters - nothing to keep in sync) */
    &[data-numbers] {
      counter-reset: mockup-line;
    }
    &[data-numbers] > pre {
      counter-increment: mockup-line;
    }
    &[data-numbers] > pre:not([data-prefix])::before {
      content: counter(mockup-line);
    }

    /* -- Tones: output lines --------------------------------------- */
    & > pre[data-tone] {
      color: var(--_tone);
    }
    & > pre[data-tone="success"] {
      --_tone: var(--_success);
    }
    & > pre[data-tone="warning"] {
      --_tone: var(--_warning);
    }
    & > pre[data-tone="info"] {
      --_tone: var(--_info);
    }
    & > pre[data-tone="destructive"] {
      --_tone: var(--_destructive);
    }
    & > pre[data-tone="muted"] {
      --_tone: var(--_dim);
    }

    /* -- Highlighted line: a tinted band in the line's tone (or the
       text colour); data-highlight="solid" fills it -------------- */
    & > pre[data-highlight] {
      background: color-mix(in oklch, var(--_tone, var(--_fg)) 16%, transparent);
    }
    & > pre[data-highlight="solid"] {
      background: var(--_tone, var(--_fg));
      color: var(--_bg);
      &::before {
        color: inherit;
        opacity: 0.7;
      }
    }

    /* -- Diff: data-diff="add" / "remove" lines ----------------------
       The sign sits in its own column before the code (generated, never
       copied), so numbers and prompts keep theirs; every line of a diff
       window gets the column, so context lines line up. Word changes
       inside a line are native <ins> / <del>. */
    &:where(:has(> pre[data-diff])) > pre > code::before {
      content: "";
      display: inline-block;
      width: 2ch;
      user-select: none;
    }
    & > pre[data-diff="add"] {
      --_tone: var(--_success);
    }
    & > pre[data-diff="remove"] {
      --_tone: var(--_destructive);
    }
    & > pre[data-diff] {
      color: var(--_tone);
      background: color-mix(in oklch, var(--_tone) 14%, transparent);
    }
    & > pre[data-diff="add"] > code::before {
      content: "+";
    }
    & > pre[data-diff="remove"] > code::before {
      content: "-";
    }
    & > pre > code :is(ins, del) {
      border-radius: 0.2em;
      color: inherit;
      text-decoration: none;
    }
    & > pre > code ins {
      background: color-mix(in oklch, var(--_success) 32%, transparent);
    }
    & > pre > code del {
      background: color-mix(in oklch, var(--_destructive) 32%, transparent);
      text-decoration: line-through;
    }
    /* data-strike (and the animated diff) strikes removed lines through */
    &:is([data-strike], [data-animate]) > pre[data-diff="remove"] {
      opacity: 0.8;
      & > code {
        text-decoration: line-through;
        text-decoration-color: color-mix(in oklch, var(--_tone) 70%, transparent);
      }
    }

    /* -- Animated diff: removed lines turn red and strike through, added
       lines slide in green, one after another; context lines stay.
       Replays whenever data-animate is set again. ------------------ */
    &[data-animate] > pre {
      --_stagger: var(--mockup-code-stagger, 140ms);
      --_delay: calc(var(--mockup-code-delay, 300ms) + var(--_i, 0) * var(--_stagger));
    }
    &[data-animate] > pre[data-diff="remove"] {
      animation: mockup-code-remove 450ms ease-out var(--_delay) both;
      & > code {
        animation: mockup-code-strike 450ms ease-out var(--_delay) both;
      }
    }
    &[data-animate] > pre[data-diff="add"] {
      animation: mockup-code-add 450ms cubic-bezier(0.2, 0.8, 0.2, 1) var(--_delay) both;
    }

    /* -- Cursor: a blinking block after the line --------------------- */
    & > pre[data-cursor] > code::after {
      content: "";
      display: inline-block;
      width: 0.6em;
      height: 1.15em;
      margin-inline-start: 0.1em;
      vertical-align: text-bottom;
      background: currentColor;
      animation: mockup-code-cursor 1s steps(1) infinite;
    }

    /* -- Wrap instead of scrolling --------------------------------- */
    &[data-wrap] {
      grid-template-columns: minmax(0, 1fr);
    }
    &[data-wrap] > pre {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      padding-inline-start: calc(var(--_px) + 3.25ch);
      text-indent: -3.25ch;
    }
    &[data-wrap] > pre:not([data-prefix]):not(:where([data-numbers] > pre)) {
      padding-inline-start: var(--_px);
      text-indent: 0;
    }

    /* -- Variants (surfaces) --------------------------------------- */
    &[data-variant="muted"],
    &[data-variant="outline"] {
      --_fg: var(--foreground);
      --_dim: var(--muted-foreground);
      --_success: oklch(0.52 0.14 150);
      --_warning: oklch(0.58 0.14 70);
      --_info: oklch(0.52 0.14 250);
      --_destructive: var(--destructive);
    }
    &[data-variant="muted"] {
      --_bg: var(--muted);
    }
    &[data-variant="outline"] {
      --_bg: var(--card);
      border: 1px solid var(--border);
    }
    &[data-variant="primary"] {
      --_bg: var(--primary);
      --_fg: var(--primary-foreground);
      --_dim: color-mix(in oklch, var(--primary-foreground) 65%, var(--primary));
    }

    /* -- Sizes ------------------------------------------------------ */
    &[data-size="sm"] {
      font-size: 0.75rem;
      --_px: 1rem;
      padding-block: 1rem 0.75rem;
    }
    &[data-size="lg"] {
      font-size: 1rem;
      --_px: 1.5rem;
    }
  }

  @keyframes mockup-code-cursor {
    50% {
      opacity: 0;
    }
  }
  /* each keyframe starts neutral and ends on the line's own diff styles */
  @keyframes mockup-code-remove {
    from {
      color: var(--_fg);
      background: transparent;
      opacity: 1;
    }
  }
  @keyframes mockup-code-strike {
    from {
      text-decoration-color: transparent;
    }
  }
  @keyframes mockup-code-add {
    from {
      color: var(--_fg);
      background: transparent;
      opacity: 0;
      translate: -1.5rem 0;
    }
  }

  /* the line's position drives the stagger: sibling-index() where the
     browser has it, a counted fallback for the first 24 lines elsewhere */
  @supports (order: sibling-index()) {
    .mockup-code[data-animate] > pre {
      --_i: sibling-index();
    }
  }
  @supports not (order: sibling-index()) {
    .mockup-code[data-animate] > pre:nth-child(2) {
      --_i: 2;
    }
    .mockup-code[data-animate] > pre:nth-child(3) {
      --_i: 3;
    }
    .mockup-code[data-animate] > pre:nth-child(4) {
      --_i: 4;
    }
    .mockup-code[data-animate] > pre:nth-child(5) {
      --_i: 5;
    }
    .mockup-code[data-animate] > pre:nth-child(6) {
      --_i: 6;
    }
    .mockup-code[data-animate] > pre:nth-child(7) {
      --_i: 7;
    }
    .mockup-code[data-animate] > pre:nth-child(8) {
      --_i: 8;
    }
    .mockup-code[data-animate] > pre:nth-child(9) {
      --_i: 9;
    }
    .mockup-code[data-animate] > pre:nth-child(10) {
      --_i: 10;
    }
    .mockup-code[data-animate] > pre:nth-child(11) {
      --_i: 11;
    }
    .mockup-code[data-animate] > pre:nth-child(12) {
      --_i: 12;
    }
    .mockup-code[data-animate] > pre:nth-child(13) {
      --_i: 13;
    }
    .mockup-code[data-animate] > pre:nth-child(14) {
      --_i: 14;
    }
    .mockup-code[data-animate] > pre:nth-child(15) {
      --_i: 15;
    }
    .mockup-code[data-animate] > pre:nth-child(16) {
      --_i: 16;
    }
    .mockup-code[data-animate] > pre:nth-child(n + 17) {
      --_i: 17;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .mockup-code > pre[data-cursor] > code::after {
      animation: none;
    }
    /* the diff shows its end state at once */
    .mockup-code[data-animate] > pre,
    .mockup-code[data-animate] > pre > code {
      animation: none;
    }
  }
}

/* paper cannot scroll: printed, every line wraps as with data-wrap, and the
   window prints its colors as designed - a print dialog drops background
   graphics by default, which left the terminal's light text pale on white
   paper. An animated diff prints its end state. */
@media print {
  @layer components {
    .mockup-code {
      overflow-x: visible;
      grid-template-columns: minmax(0, 1fr);
      print-color-adjust: exact;
    }
    .mockup-code > pre {
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      padding-inline-start: calc(var(--_px) + 3.25ch);
      text-indent: -3.25ch;
    }
    .mockup-code > pre:not([data-prefix]):not(:where([data-numbers] > pre)) {
      padding-inline-start: var(--_px);
      text-indent: 0;
    }
    .mockup-code > pre[data-cursor] > code::after,
    .mockup-code[data-animate] > pre,
    .mockup-code[data-animate] > pre > code {
      animation: none;
    }
  }
}

@media (prefers-contrast: more) {
  @layer components {
    .mockup-code {
      --_dim: var(--_fg);
      border: 1px solid var(--_fg);
    }
  }
}

@media (forced-colors: active) {
  @layer components {
    .mockup-code {
      border: 1px solid CanvasText;
    }
    .mockup-code > pre[data-highlight] {
      forced-color-adjust: none;
      background: Highlight;
      color: HighlightText;
    }
    /* the +/- signs carry the diff; <ins>/<del> get system marks */
    .mockup-code > pre > code :is(ins, del) {
      outline: 1px solid CanvasText;
    }
  }
}

/* ── components/number-input/number-input.css ── */
/* -- Number Input component ------------------------------------- */

@layer components {
  .number-input {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    /* explicit border-box: the size ladder below sets an explicit container
       height and must land on it exactly (a div is content-box by default;
       inputs get border-box from the UA). The unsized default keeps its
       auto height (children drive it), so this changes nothing today. */
    box-sizing: border-box;
    /* explicit default box height (the size ladder below does the rest): an
       auto-height box let the UA-padding children overshoot to 44px. The
       unsized default IS the ladder's md step - field standard, see .input */
    height: 2.25rem;

    & input {
      border: none;
      outline: none;
      background: transparent;
      height: 100%;
      /* 4rem basis, but GROWS when the container is widened (w-full demos,
         grid cells): a fixed width left dead space after the + button.
         width pins the intrinsic size too - Chrome otherwise derives a
         number input's width from the digit count of max (no max: ~170px,
         max="100": 34px), so the field width followed a validation attr. */
      flex: 1 1 4rem;
      width: 4rem;
      min-width: 0;
      text-align: center;
      font-size: 0.875rem;
      font-family: var(--font-sans);
      color: var(--foreground);
      -moz-appearance: textfield;

      &::-webkit-inner-spin-button,
      &::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
      }
    }

    & button {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 2rem;
      /* height:100% so the button can't overshoot the container's border-box
         height (the ladder below already sets children to 100%) */
      height: 100%;
      border: none;
      background: transparent;
      color: var(--muted-foreground);
      cursor: pointer;
      font-size: 1rem;
      font-family: var(--font-sans);
      transition:
        background 150ms,
        color 150ms;
      flex-shrink: 0;

      &:hover {
        background: var(--accent);
        color: var(--accent-foreground);
      }

      &:first-child {
        border-right: 1px solid var(--input);
      }

      &:last-child {
        border-left: 1px solid var(--input);
      }
    }

    /* -- Unit affix: <label class="number-input-unit" for="…"> -----
       A unit (°C, %, kg, €, h) sits before or after the input. It is a
       second <label> for the input: clicking it focuses the field and the
       unit joins the accessible name ("Temperature °C"). The value aligns
       TOWARD the unit so number + unit read as one ("19.0 °C", "€ 24.90"). */
    & .number-input-unit {
      display: flex;
      align-items: center;
      align-self: stretch;
      flex-shrink: 0;
      padding-inline: 0.25rem;
      color: var(--muted-foreground);
      font-size: 0.875rem;
      font-family: var(--font-sans);
      white-space: nowrap;
      cursor: text;

      /* edge of the box (no stepper on that side): field padding */
      &:first-child {
        padding-inline-start: 0.75rem;
      }
      &:last-child {
        padding-inline-end: 0.75rem;
      }
    }

    /* NOT user-select: none - the unit is part of the value when text is
       selected, copied or exported ("72,5 kg", not a bare "72,5") */

    &:has(input:not([type="hidden"]) + .number-input-unit) input {
      text-align: end;
    }
    &:has(.number-input-unit + input:not([type="hidden"])) input {
      text-align: start;
    }

    /* currency fields carry grouped amounts ("1.234.567,89") */
    &[data-currency] input {
      width: 8rem;
    }

    /* stepper-less field (currency, measurements): the input reaches the box
       edge - give it the regular field padding there */
    & input:first-child {
      padding-inline-start: 0.75rem;
    }
    & input:last-child {
      padding-inline-end: 0.75rem;
    }

    &:focus-within {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    /* -- Sizes -------------------------------------------------
       Container height + input/button/font scale together, matching the
       input/button ladders (md = 2.25rem; the unsized default stays at the
       historical 2.5rem, exactly like .input does). Children switch to
       height:100% so they can't fight the container. */
    &[data-size="xs"] {
      height: 1.75rem;
      & input {
        height: 100%;
        width: 3rem;
        font-size: 0.75rem;
      }
      & button {
        height: 100%;
        width: 1.5rem;
        font-size: 0.875rem;
      }
      & .number-input-unit {
        font-size: 0.75rem;
      }
    }
    &[data-size="sm"] {
      height: 2rem;
      & input {
        height: 100%;
        width: 3.5rem;
        font-size: 0.8125rem;
      }
      & button {
        height: 100%;
        width: 1.75rem;
        font-size: 0.9375rem;
      }
      & .number-input-unit {
        font-size: 0.8125rem;
      }
    }
    &[data-size="md"] {
      height: 2.25rem;
      & input {
        height: 100%;
        font-size: 0.875rem;
      }
      & button {
        height: 100%;
      }
    }
    &[data-size="lg"] {
      height: 2.75rem;
      & input {
        height: 100%;
        width: 4.5rem;
        font-size: 1rem;
      }
      & button {
        height: 100%;
        width: 2.25rem;
        font-size: 1.125rem;
      }
      & .number-input-unit {
        font-size: 1rem;
      }
    }
    &[data-size="xl"] {
      height: 3.25rem;
      & input {
        height: 100%;
        width: 5rem;
        font-size: 1.125rem;
      }
      & button {
        height: 100%;
        width: 2.5rem;
        font-size: 1.25rem;
      }
      & .number-input-unit {
        font-size: 1.125rem;
      }
    }
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .number-input,
    .number-input *,
    .number-input::before,
    .number-input::after,
    .number-input *::before,
    .number-input *::after,
    .number-input::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/questionnaire/questionnaire.css ── */
/* -- Questionnaire ------------------------------------------------- */
/* One question at a time: a <form> whose steps are <fieldset>s; the  */
/* controller shows one (hidden on the others) - without JavaScript    */
/* every step shows and it is a plain long form.                       */

@layer components {
  .questionnaire {
    display: grid;
    gap: 1.25rem;
    width: 100%;
    color: var(--foreground);

    &[data-busy] {
      cursor: progress;

      & .questionnaire-actions {
        opacity: 0.6;
        pointer-events: none;
      }
    }
  }

  .questionnaire-block {
    display: grid;
    gap: 1rem;
  }

  /* the block's own heading (optional) */
  .questionnaire-block-title {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* -- a step ----------------------------------------------------- */
  .questionnaire-step {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;

    &:not([hidden]) {
      animation: questionnaire-in 220ms ease both;
    }
  }

  .questionnaire-title {
    padding: 0;
    margin-block-end: 0.25rem;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  .questionnaire-description {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.9375rem;
    text-wrap: pretty;
  }

  .questionnaire-field {
    display: grid;
    gap: 0.375rem;
  }

  /* -- choices: cards with a key badge (A, B, C …) ------------------ */
  .questionnaire-choices {
    display: grid;
    gap: 0.5rem;

    &[data-columns="2"] {
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    }
  }

  .questionnaire-choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem 0.5rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    cursor: pointer;
    transition:
      border-color 120ms ease,
      background-color 120ms ease;

    /* the native control stays (keyboard, form data), the card shows the state */
    & > input[type="radio"],
    & > input[type="checkbox"] {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      opacity: 0;
      cursor: pointer;
    }

    &::before {
      content: attr(data-key);
      flex: none;
      display: grid;
      place-items: center;
      min-width: 1.5rem;
      height: 1.5rem;
      padding-inline: 0.25rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--card);
      color: var(--muted-foreground);
      font-size: 0.75rem;
      font-weight: 600;
      font-variant-numeric: tabular-nums;
    }

    &:not([data-key])::before {
      content: none;
    }

    &:hover {
      border-color: color-mix(in oklch, var(--primary) 45%, var(--border));
      background: color-mix(in oklch, var(--accent) 50%, var(--background));
    }

    &:has(> input:checked) {
      border-color: var(--primary);
      background: color-mix(in oklch, var(--primary) 8%, var(--background));

      &::before {
        border-color: var(--primary);
        background: var(--primary);
        color: var(--primary-foreground);
      }
    }

    &:has(> input:focus-visible) {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    &:has(> input:disabled) {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }

  .questionnaire-choice-label {
    flex: 1;
    min-width: 0;
  }

  /* secondary text in a choice */
  .questionnaire-choice-hint {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
  }

  /* freeform "Other": typing in it picks its choice; above the card's input */
  .questionnaire-other {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    height: 2rem;
    padding-inline: 0.5rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--foreground);
    font: inherit;

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 1px;
    }
  }

  /* -- validation ----------------------------------------------------- */
  .questionnaire-error {
    margin: 0;
    color: var(--destructive);
    font-size: 0.875rem;
    font-weight: 500;
  }

  .questionnaire-step[aria-invalid="true"] .questionnaire-choice {
    border-color: color-mix(in oklch, var(--destructive) 55%, var(--border));
  }

  /* -- progress --------------------------------------------------------- */
  .questionnaire-progress {
    display: grid;
    gap: 0.5rem;
  }

  .questionnaire-progress-label {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
  }

  .questionnaire-bar {
    width: 100%;
    height: 0.375rem;
    border: 0;
    border-radius: 999px;
    background: var(--muted);
    accent-color: var(--primary);
    appearance: none;
    overflow: hidden;

    &::-webkit-progress-bar {
      background: var(--muted);
    }

    &::-webkit-progress-value {
      background: var(--primary);
      border-radius: 999px;
      transition: inline-size 300ms ease;
    }

    &::-moz-progress-bar {
      background: var(--primary);
      border-radius: 999px;
    }
  }

  .questionnaire-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
  }

  .questionnaire-block-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--muted-foreground);

    &::before {
      content: "";
      width: 0.5rem;
      height: 0.5rem;
      border: 1.5px solid currentColor;
      border-radius: 50%;
    }

    &[data-status="done"]::before {
      background: currentColor;
    }

    &[data-status="current"] {
      color: var(--foreground);
      font-weight: 600;

      &::before {
        border-color: var(--primary);
        background: var(--primary);
      }
    }
  }

  /* -- navigation --------------------------------------------------------- */
  .questionnaire-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;

    & [data-questionnaire="next"],
    & [data-questionnaire="submit"] {
      margin-inline-start: auto;
    }
  }

  /* a draft came back / answers were cleared */
  .questionnaire-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--muted);
    color: var(--muted-foreground);
    font-size: 0.8125rem;
  }

  .questionnaire-notice-action,
  .questionnaire-edit {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
      border-radius: 2px;
    }
  }

  /* -- branch history ------------------------------------------------------- */
  .questionnaire-trail-list {
    display: grid;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: questionnaire-trail;

    & li {
      counter-increment: questionnaire-trail;
    }

    & li[data-status="ahead"] {
      opacity: 0.55;
    }
  }

  .questionnaire-trail-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 0.5rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;

    &::before {
      content: counter(questionnaire-trail);
      grid-row: span 2;
      display: grid;
      place-items: center;
      width: 1.25rem;
      height: 1.25rem;
      border-radius: 50%;
      background: var(--muted);
      color: var(--muted-foreground);
      font-size: 0.6875rem;
      font-weight: 600;
    }

    &[aria-current="step"] {
      background: var(--accent);
      color: var(--accent-foreground);

      &::before {
        background: var(--primary);
        color: var(--primary-foreground);
      }
    }

    &:hover {
      background: var(--accent);
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: -2px;
    }
  }

  .questionnaire-trail-question {
    font-size: 0.8125rem;
    font-weight: 500;
  }

  .questionnaire-trail-answer {
    overflow: hidden;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* -- review --------------------------------------------------------------- */
  .questionnaire-summary-list {
    display: grid;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }

  .questionnaire-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.25rem 1rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;

    & + & {
      border-top: 1px solid var(--border);
    }

    & dt {
      color: var(--muted-foreground);
    }

    & dd {
      display: flex;
      justify-content: space-between;
      gap: 0.75rem;
      margin: 0;
      font-weight: 500;
    }
  }

  .questionnaire-complete {
    display: grid;
    gap: 0.5rem;
    animation: questionnaire-in 220ms ease both;
  }

  /* the controller hides with [hidden]: it must win over every display above
     (and over a .btn's own display) */
  .questionnaire
    :is(
      .questionnaire-block,
      .questionnaire-step,
      .questionnaire-actions,
      .questionnaire-complete,
      .questionnaire-notice,
      .questionnaire-error,
      [data-questionnaire]
    )[hidden] {
    display: none;
  }

  @keyframes questionnaire-in {
    from {
      opacity: 0;
      translate: 0 0.5rem;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .questionnaire-step:not([hidden]),
    .questionnaire-complete,
    .questionnaire-choice,
    .questionnaire-bar::-webkit-progress-value {
      animation: none;
      transition: none;
    }
  }
}

@media (prefers-contrast: more) {
  @layer components {
    .questionnaire-choice,
    .questionnaire-summary-list {
      border-color: var(--foreground);
    }

    .questionnaire-description,
    .questionnaire-progress-label,
    .questionnaire-trail-answer {
      color: var(--foreground);
    }
  }
}

@media (forced-colors: active) {
  @layer components {
    .questionnaire-choice {
      border-color: ButtonText;

      &:has(> input:checked) {
        border-color: Highlight;
        outline: 2px solid Highlight;
      }
    }

    .questionnaire-bar {
      border: 1px solid CanvasText;
    }

    .questionnaire-error {
      color: LinkText;
    }
  }
}

/* ── components/radio/radio.css ── */
/* -- Radio Group component -------------------------------------- */

@layer components {
  .radio-group {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    & > legend {
      /* top + bottom breathing room: stacked groups (e.g. a density ladder
         demo) would otherwise jam each heading against the options above it */
      margin-top: 0.5rem;
      margin-bottom: 0.375rem;
    }

    /* Horizontal layout */
    &[data-orientation="horizontal"] {
      flex-direction: row;
      flex-wrap: wrap;
      gap: 1rem;
    }
  }

  .radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    & > label {
      font-size: 0.875rem;
      font-weight: 400;
      cursor: pointer;
    }
  }

  /* -- With-description layout -------------------------------- */
  .radio-item-block {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 0.5rem;

    & > .radio {
      grid-row: 1 / 3;
      margin-top: 0.125rem;
    }

    & > label {
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      line-height: 1.4;
    }

    & > .radio-description {
      grid-column: 2;
      font-size: 0.8125rem;
      color: var(--muted-foreground);
      line-height: 1.5;
    }
  }

  /* -- Density --------------------------------------------------
     data-density on the .radio-group root is a whitespace policy: the gap
     between options (and card padding) scale at the shared 0.75 / 1 / 1.25
     ratio; comfortable matches the unsized default. Radio size itself stays
     fixed - this is spacing, not zoom. */
  .radio-group:where([data-density="compact"]) {
    gap: 0.25rem;
    &[data-orientation="horizontal"] {
      gap: 0.75rem;
    }
    & .radio-card {
      padding: 0.75rem 1rem;
    }
  }
  .radio-group:where([data-density="comfortable"]) {
    gap: 0.5rem;
    &[data-orientation="horizontal"] {
      gap: 1rem;
    }
  }
  .radio-group:where([data-density="spacious"]) {
    gap: 0.75rem;
    &[data-orientation="horizontal"] {
      gap: 1.5rem;
    }
    & .radio-card {
      padding: 1.25rem 1.5rem;
    }
  }

  /* Gap hit area: inside an item layout the radio's click target spans the
     gap to its label (a transparent ::before, part of the input's own hit
     box), so clicking the whitespace between circle and text selects too -
     the label's `for` covers the text itself. Inline-end only: the label
     always sits after the radio (the block layout's second grid column). */
  :is(.radio-item, .radio-item-block) > .radio::before {
    content: "";
    position: absolute;
    inset-block: -0.25rem;
    inset-inline: -0.25rem -0.5rem;
  }

  /* -- Card variant ------------------------------------------- */
  .radio-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition:
      border-color 150ms,
      background 150ms;

    &:hover {
      background: var(--accent);
    }

    &:has(.radio:checked) {
      border-color: var(--primary);
    }

    &:has(.radio:focus-visible) {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    &:has(.radio:disabled) {
      cursor: not-allowed;
      background: var(--muted);

      &:hover {
        background: var(--muted);
      }
      & > label {
        color: var(--muted-foreground);
        cursor: not-allowed;
      }
    }

    & > .radio {
      position: absolute;
      top: 1rem;
      right: 1rem;
    }

    & > label {
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
    }

    & > .radio-description {
      font-size: 0.8125rem;
      color: var(--muted-foreground);
      line-height: 1.5;
    }
  }

  .radio {
    appearance: none;
    margin: 0; /* kill the UA's ~4px input margin - breaks flex/grid rhythm */
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--background);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 150ms;

    &:checked {
      border-color: var(--primary);

      &::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0.5rem;
        height: 0.5rem;
        border-radius: 50%;
        background: var(--primary);
        transform: translate(-50%, -50%);
      }
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    /* Disabled = legible but inert: never an opacity fade (0.5 on a light
       --border edge left a ghost you had to look for). The shape keeps its
       full-strength edge, the surface turns muted, a chosen state keeps a
       softened primary fill, and the label goes muted with the no-entry
       cursor - "a choice that exists but is unavailable right now". */
    &:disabled {
      background: var(--muted);
      /* a mid-grey ring: --border on the muted fill is too faint to read as a shape */
      border-color: color-mix(in oklch, var(--muted-foreground) 50%, var(--background));
      cursor: not-allowed;

      &:checked {
        border-color: color-mix(in oklch, var(--primary) 45%, var(--background));

        &::after {
          background: color-mix(in oklch, var(--primary) 45%, var(--background));
        }
      }

      & + label {
        color: var(--muted-foreground);
        cursor: not-allowed;
      }
    }

    &[aria-invalid="true"] {
      border-color: var(--destructive);

      &:checked {
        border-color: var(--destructive);

        &::after {
          background: var(--destructive);
        }
      }
    }
  }

  /* Helper text for group-level descriptions */
  .radio-group-description {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin: -0.125rem 0 0.25rem;
  }

  /* -- Accessibility ------------------------------------------ */
  @media (prefers-reduced-motion: reduce) {
    .radio,
    .radio-card {
      transition: none;
    }
  }

  @media (forced-colors: active) {
    .radio {
      border-color: ButtonText;

      &:checked {
        border-color: Highlight;

        &::after {
          background: Highlight;
        }
      }

      &:disabled {
        border-color: GrayText;

        &:checked::after {
          background: GrayText;
        }
      }
    }

    .radio-card {
      border-color: ButtonText;

      &:has(.radio:checked) {
        border-color: Highlight;
      }
    }
  }
}

/* ── components/rating/rating.css ── */
/* -- Rating component ------------------------------------------- */
/* Star rating. Interactive form is a native radio group (no JS);   */
/* the read-only form is a display-only fraction of five stars.     */

@layer components {
  .rating {
    /* Local knobs — not theme tokens: there is no amber in the tweakcn
       shape, and a rating's fill colour is a per-instance decision
       (stars amber, hearts destructive, …). Override inline or in a
       wrapper rule; both forms below read them. */
    --rating-color: #f59e0b;
    --rating-empty: var(--border);
    --rating-size: 1.25rem;

    border: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    line-height: 1;

    &[data-size="sm"] {
      --rating-size: 1rem;
    }

    &[data-size="lg"] {
      --rating-size: 1.75rem;
    }

    /* -- Glyph: any text glyph via --rating-glyph (the read-only form reads
       --rating-glyphs, the same glyph five times); data-glyph="heart" is
       the common one, in the destructive colour. U+FE0E keeps ♥ a text
       glyph (an emoji heart would ignore color). */
    &[data-glyph="heart"] {
      --rating-glyph: "\2665\FE0E";
      --rating-glyphs: "\2665\FE0E\2665\FE0E\2665\FE0E\2665\FE0E\2665\FE0E";
      --rating-color: var(--destructive);
    }
  }

  /* -- Interactive form (radio group) ------------------------- */
  .rating-item {
    position: relative;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    line-height: 1;

    &::before {
      content: var(--rating-glyph, "★");
      font-size: var(--rating-size);
      color: var(--rating-empty);
      transition:
        color 150ms,
        scale 150ms;
    }
  }

  /* The radio stays in the accessibility tree and keeps keyboard support —
     it is only visually replaced by the star drawn above. */
  .rating-input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
  }

  /* Filled: this star, and every star before the checked one. */
  .rating-item:has(.rating-input:checked)::before,
  .rating-item:has(~ .rating-item .rating-input:checked)::before {
    color: var(--rating-color);
  }

  /* Hover preview wins over the current value while the pointer is on the
     group: reset all, then fill up to the hovered star. Specificity is
     deliberate — each rule must outrank the checked rules above.
     A disabled group is excluded: previewing a value there would promise a
     choice the control cannot accept. */
  @media (hover: hover) {
    .rating:not(:has(.rating-input:disabled)):has(.rating-item:hover) .rating-item::before {
      color: var(--rating-empty);
    }

    .rating:not(:has(.rating-input:disabled)):has(.rating-item:hover) .rating-item:hover::before,
    .rating:not(:has(.rating-input:disabled)):has(.rating-item:hover) .rating-item:has(~ .rating-item:hover)::before {
      color: var(--rating-color);
      scale: 1.1;
    }
  }

  .rating-item:has(.rating-input:focus-visible) {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
  }

  /* Disabled — native <fieldset disabled> propagates to every radio. */
  .rating:has(.rating-input:disabled) {
    opacity: 0.5;

    /* the star and the radio stretched over it must agree — a hand on one and
       "no entry" on the other invites a click the control cannot take */
    & .rating-item,
    & .rating-input {
      cursor: not-allowed;
    }
  }

  .rating[data-readonly] .rating-item {
    cursor: default;
  }

  /* -- Read-only form (fractional display) -------------------- */
  /* Two layers of five stars: empty underneath, filled on top clipped to
     the value — so 3.5 renders a half star with no extra markup. */
  .rating[data-readonly] {
    position: relative;
    display: inline-block;
    font-size: var(--rating-size);
    letter-spacing: 0.125rem;

    &::before,
    &::after {
      content: var(--rating-glyphs, "★★★★★");
      line-height: 1;
    }

    &::before {
      color: var(--rating-empty);
    }

    &::after {
      position: absolute;
      inset-block: 0;
      inset-inline-start: 0;
      width: calc(var(--rating-value, 0) / 5 * 100%);
      overflow: hidden;
      white-space: nowrap;
      color: var(--rating-color);
    }
  }

  /* -- Label beside the stars --------------------------------- */
  .rating-value {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-inline-start: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  @layer components {
    .rating,
    .rating *,
    .rating::before,
    .rating::after,
    .rating *::before,
    .rating *::after,
    .rating-item,
    .rating-item *,
    .rating-item::before,
    .rating-item::after {
      transition: none;
      animation: none;
      scale: none;
    }
  }
}

@media (prefers-contrast: more) {
  @layer components {
    .rating {
      --rating-empty: var(--muted-foreground);
    }

    .rating-item:has(.rating-input:focus-visible) {
      outline-width: 3px;
    }
  }
}

@media (forced-colors: active) {
  @layer components {
    .rating {
      --rating-color: Highlight;
      --rating-empty: GrayText;

      &:has(.rating-input:disabled) {
        --rating-color: GrayText;
      }
    }

    .rating-item:has(.rating-input:focus-visible) {
      outline-color: Highlight;
    }
  }
}

/* ── components/select/select.css ── */
/* -- Select component ------------------------------------------- */

@layer components {
  .select {
    appearance: none;
    /* the field standard: unsized = md step (see .input) */
    height: 2.25rem;
    width: 100%;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    padding: 0 2rem 0 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--foreground);
    outline: none;
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition:
      border-color 150ms,
      box-shadow 150ms;

    /* Custom chevron */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;

    /* Placeholder = the empty-value option. It stays selectable (no
       `disabled`) so it doubles as the clear/reset entry - choosing it
       again empties the box (issue #32). While it is the selection the
       closed control reads as a placeholder; a real value restores
       --foreground because the base rule's color wins over this one.
       option:checked matches the *selected* option in every engine. */
    &:has(> option[value=""]:checked) {
      color: var(--muted-foreground);
    }

    &:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    /* Disabled = legible but inert: a muted surface and muted text inside
       the full-strength border - never an opacity fade that lets the box
       dissolve into the page. */
    &:disabled {
      background-color: var(--muted);
      color: var(--muted-foreground);
      box-shadow: none;
      cursor: not-allowed;
      opacity: 1; /* Chrome's UA sheet fades select:disabled to 0.7 on its own */
    }

    &:is([aria-invalid="true"], :user-invalid:not(form[data-validate="submit"]:not([data-submitted]) *)) {
      border-color: var(--destructive);

      &:focus {
        border-color: var(--destructive);
        box-shadow: 0 0 0 2px oklch(from var(--destructive) l c h / 0.2);
      }
    }

    /* -- Multiple (<select multiple>) ---------------------------
       The browser renders a list box instead of a dropdown: every option is
       visible (size="N" rows), Ctrl/⌘-click or Shift-click / Shift+arrows
       pick several, and the form submits every chosen value under the same
       name. No fixed height, no chevron; chosen options get a tinted row. */
    &[multiple] {
      height: auto;
      padding: 0.25rem;
      background-image: none;
      overflow-y: auto;

      & option {
        padding: 0.375rem 0.5rem;
        border-radius: calc(var(--radius-md) - 2px);
        color: var(--foreground);
      }

      & option:checked {
        /* a gradient beats the UA's opaque selection paint in every engine */
        background: linear-gradient(
          color-mix(in oklch, var(--primary) 14%, transparent),
          color-mix(in oklch, var(--primary) 14%, transparent)
        );
        font-weight: 500;
      }

      /* one unavailable choice in a usable list */
      & option:disabled {
        color: var(--muted-foreground);
        cursor: not-allowed;
      }

      & optgroup {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--muted-foreground);
      }
    }

    /* -- Sizes ----------------------------------------------- */
    &[data-size="xs"] {
      height: 1.75rem;
      padding-left: 0.5rem;
      font-size: 0.75rem;
    }
    &[data-size="sm"] {
      height: 2rem;
      padding-left: 0.625rem;
      font-size: 0.8125rem;
    }
    &[data-size="md"] {
      height: 2.25rem;
      padding-left: 0.75rem;
      font-size: 0.875rem;
    }
    &[data-size="lg"] {
      height: 2.75rem;
      padding-left: 1rem;
      font-size: 1rem;
    }
    &[data-size="xl"] {
      height: 3.25rem;
      padding-left: 1.25rem;
      font-size: 1.125rem;
    }

    &[multiple][data-size] {
      height: auto;
    }
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .select,
    .select *,
    .select::before,
    .select::after,
    .select *::before,
    .select *::after,
    .select::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/separator/separator.css ── */
/* -- Separator component ---------------------------------------- */

@layer components {
  /* One element, three looks:
     - empty: a plain line (1px, --border) - horizontal, or vertical with
       data-orientation="vertical" (inside a flex row)
     - with text inside: the text sits ON the line - two pseudo-element lines
       left and right of it (above and below when vertical)
     Knobs: data-variant (line color), data-size (thickness), data-gap (space
     between text and lines), data-align="start|end" (text position),
     data-orientation-md / -lg="vertical" (switch to a vertical line from
     48 / 64rem). --_line / --_thick / --_gap are private. */
  .separator {
    --_line: var(--border);
    --_thick: 1px;
    --_gap: 0.75rem;
    border: none;
    margin: 0;
    flex-shrink: 0;
    background: var(--_line);

    /* Horizontal (default) */
    height: var(--_thick);
    width: 100%;

    /* Vertical */
    &[data-orientation="vertical"] {
      height: auto;
      width: var(--_thick);
      align-self: stretch;
    }

    /* Decorative - hidden from assistive technology */
    &[aria-hidden="true"],
    &[role="none"] {
      /* No visual change - purely semantic */
    }

    /* -- Text on the line ------------------------------------ */
    &:not(:empty) {
      display: flex;
      align-items: center;
      gap: var(--_gap);
      height: auto;
      background: none;
      font-size: 0.75rem;
      font-weight: 500;
      line-height: 1.25rem;
      letter-spacing: 0.02em;
      color: var(--muted-foreground);
      white-space: nowrap;

      &::before,
      &::after {
        content: "";
        flex: 1 1 0;
        height: var(--_thick);
        background: var(--_line);
      }

      /* text position along the line */
      &[data-align="start"]::before {
        display: none;
      }
      &[data-align="end"]::after {
        display: none;
      }

      /* a bare glyph - an asterism, a dinkus, a fleuron - without the lines.
         VERIFIED: (separator.e2e "data-line=none") no pseudo lines, centred */
      &[data-line="none"] {
        justify-content: center;

        &::before,
        &::after {
          display: none;
        }
      }

      &[data-orientation="vertical"] {
        flex-direction: column;
        width: auto;
        align-self: stretch;

        &::before,
        &::after {
          width: var(--_thick);
          height: auto;
          min-height: 0.5rem;
        }
      }
    }

    /* -- Colors (the line; the text stays muted) -------------- */
    &[data-variant="neutral"] {
      --_line: var(--foreground);
    }
    &[data-variant="primary"] {
      --_line: var(--primary);
    }
    /* the tweakcn --secondary / --accent are pale surfaces, too faint for a
       line: the theme's vivid chart colors instead (like the status dot) */
    &[data-variant="secondary"] {
      --_line: var(--chart-2);
    }
    &[data-variant="accent"] {
      --_line: var(--chart-4);
    }
    &[data-variant="destructive"],
    &[data-variant="error"] {
      --_line: var(--destructive);
    }
    /* success / warning / info: literals - the token set has no such pairs */
    &[data-variant="success"] {
      --_line: #16a34a;
    }
    &[data-variant="warning"] {
      --_line: #f59e0b;
    }
    &[data-variant="info"] {
      --_line: #0ea5e9;
    }

    /* -- Thickness -------------------------------------------- */
    &[data-size="sm"] {
      --_thick: 1px;
    }
    &[data-size="md"] {
      --_thick: 2px;
    }
    &[data-size="lg"] {
      --_thick: 4px;
    }
    &[data-size="xl"] {
      --_thick: 8px;
    }

    /* -- Gap between the text and the lines ------------------- */
    &[data-gap="none"] {
      --_gap: 0;
    }
    &[data-gap="sm"] {
      --_gap: 0.375rem;
    }
    &[data-gap="md"] {
      --_gap: 0.75rem;
    }
    &[data-gap="lg"] {
      --_gap: 1.5rem;
    }
    &[data-gap="xl"] {
      --_gap: 2.5rem;
    }

    /* -- Responsive: a vertical line from a breakpoint up (DaisyUI's
       lg:divider-horizontal). The PARENT must turn into a row at the
       same width - the separator only follows it. */
    @media (min-width: 48rem) {
      &[data-orientation-md="vertical"] {
        height: auto;
        width: var(--_thick);
        align-self: stretch;

        &:not(:empty) {
          flex-direction: column;
          width: auto;

          &::before,
          &::after {
            width: var(--_thick);
            height: auto;
            min-height: 0.5rem;
          }
        }
      }
    }
    @media (min-width: 64rem) {
      &[data-orientation-lg="vertical"] {
        height: auto;
        width: var(--_thick);
        align-self: stretch;

        &:not(:empty) {
          flex-direction: column;
          width: auto;

          &::before,
          &::after {
            width: var(--_thick);
            height: auto;
            min-height: 0.5rem;
          }
        }
      }
    }
  }

  /* -- Labeled separator (the older wrapper form) --------------
     Still supported; text inside .separator itself is the simpler form. */
  .separator-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;

    & .separator {
      flex: 1;
    }

    & span {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--muted-foreground);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      white-space: nowrap;
      flex-shrink: 0;
    }
  }

  /* -- Accessibility ----------------------------------------- */
  @media (forced-colors: active) {
    /* system colors would erase the line (a background) - keep it */
    .separator {
      forced-color-adjust: none;
      --_line: CanvasText;
      color: CanvasText;
    }
  }

  @media (prefers-contrast: more) {
    .separator:not([data-variant]) {
      --_line: var(--foreground);
    }
    .separator:not([data-size]) {
      --_thick: 2px;
    }
  }
}

/* ── components/session/session.css ── */
/* -- Session component -------------------------------------------
   A chat session: a scrolling transcript (role="log") that follows the
   live edge, jumps back to it, keeps its place when history loads, anchors
   new turns, and takes dropped files - plus a footer for the composer.
   The runtime keeps the data-* state current; CSS draws from it. */

@layer components {
  .session {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--card);
    color: var(--card-foreground);
  }

  /* -- Viewport: the scroller --------------------------------------- */
  .session-viewport {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* the runtime keeps the reader's place when history prepends - the
       browser's own scroll anchoring would correct twice */
    overflow-anchor: none;
    scrollbar-gutter: stable;

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: -2px;
    }
  }

  /* short threads sit at the bottom, like every chat */
  .session-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-block-start: auto;
  }

  /* rows off screen skip rendering; their size is remembered. content-
     visibility implies paint containment, which clips at the row's edge -
     the clip margin lets bubble tails, reactions and focus rings draw
     outside it */
  .session-item {
    content-visibility: auto;
    contain-intrinsic-size: auto 3.5rem;
    overflow-clip-margin: 1rem;

    &[data-current] {
      scroll-margin-block-start: 1rem;
    }
  }

  /* data-animate: new rows enter - rise (the default) from below, fade in
     place, or slide from their own side (a sent message from the end, a
     reply from the start). @starting-style: rows present at load never
     animate, only rows added later. VERIFIED: (session.e2e "data-animate")
     slide from each row's own side, fade, tokens; none under reduced motion. */
  .session[data-animate] .session-item {
    transition:
      opacity 250ms ease,
      translate 250ms ease;

    @starting-style {
      opacity: 0;
      translate: 0 0.5rem;
    }
  }
  .session[data-animate="fade"] .session-item {
    @starting-style {
      translate: none;
    }
  }
  .session[data-animate="slide"] .session-item {
    transition-duration: 320ms;
    transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);

    @starting-style {
      translate: -1.5rem 0;
    }
  }
  .session[data-animate="slide"] .session-item:has(> .message[data-align="end"]) {
    @starting-style {
      translate: 1.5rem 0;
    }
  }

  /* a streamed word: wrap each in .session-token as it arrives and it fades
     in - the reply writes itself instead of jumping word by word */
  .session[data-animate] .session-token {
    transition: opacity 180ms ease;

    @starting-style {
      opacity: 0;
    }
  }

  /* -- Scroll buttons: float over the transcript, stuck to its edge -- */
  .session-scroll-button {
    position: sticky;
    z-index: 1;
    align-self: center;
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--background);
    color: var(--foreground);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    scale: 0.85;
    visibility: hidden;
    transition:
      opacity 150ms,
      scale 150ms,
      visibility 150ms allow-discrete,
      background-color 150ms;

    /* a chevron, drawn */
    &::before {
      content: "";
      width: 0.5rem;
      height: 0.5rem;
      border-inline-end: 2px solid currentColor;
      border-block-end: 2px solid currentColor;
      rotate: 45deg;
      translate: 0 -0.125rem;
    }

    &:hover {
      background: var(--accent);
      color: var(--accent-foreground);
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    /* to the end: at the bottom edge, overlaying the last row */
    &[data-to="end"] {
      order: 2;
      inset-block-end: 0.5rem;
      margin-block-start: -2.25rem;
    }
    /* to the start: at the top edge, pointing up */
    &[data-to="start"] {
      order: -1;
      inset-block-start: 0.5rem;
      margin-block-end: -2.25rem;
      &::before {
        rotate: -135deg;
        translate: 0 0.125rem;
      }
    }
  }

  .session[data-scrollable~="end"] .session-scroll-button[data-to="end"],
  .session[data-scrollable~="start"] .session-scroll-button[data-to="start"] {
    opacity: 1;
    scale: 1;
    visibility: visible;
  }

  /* -- Footer: the composer, a status line ---------------------------- */
  .session-footer {
    flex: none;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--card);
  }

  .session-status {
    padding: 0.375rem 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 0.75rem;
  }

  /* -- Drop target: files dragged over the session ----------------------- */
  .session[data-drop-active]::after {
    content: attr(data-drop-label);
    position: absolute;
    inset: 0.5rem;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 2px dashed var(--ring);
    border-radius: var(--radius-lg);
    background: color-mix(in oklch, var(--background) 85%, transparent);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
  }

  /* -- Accessibility -------------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .session-scroll-button,
    .session[data-animate] :is(.session-item, .session-token) {
      transition: none;
    }
  }

  @media (prefers-contrast: more) {
    .session,
    .session-footer,
    .session-scroll-button {
      border-color: var(--foreground);
    }
  }

  @media (forced-colors: active) {
    .session {
      border: 1px solid CanvasText;
    }
    .session-scroll-button {
      border: 1px solid ButtonText;
    }
    .session[data-drop-active]::after {
      border-color: Highlight;
      forced-color-adjust: none;
    }
  }
}

/* ── components/sidebar/sidebar.css ── */
/* -- Sidebar component ------------------------------------------ */
/* Application sidebar with collapsible state, mobile sheet overlay, */
/* collapsible groups, submenus, and keyboard shortcut (Cmd+B).      */

@layer components {
  /* ── Shell layout ─────────────────────────────────────────── */
  .sidebar-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* ── Sidebar panel ────────────────────────────────────────── */
  .app-sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width, 16rem);
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
    background-color: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    transition: width 200ms ease;
    overflow: hidden;
    z-index: 30;

    /* Right side */
    &[data-side="right"] {
      border-right: none;
      border-left: 1px solid var(--sidebar-border);
      order: 1;
    }

    /* Collapsed - icon-only rail */
    &[data-state="collapsed"] {
      width: var(--sidebar-width-collapsed, 3.5rem);

      & .sidebar-link span:not(.sidebar-icon, .sidebar-dot),
      & .sidebar-section-title,
      & .sidebar-group-action,
      & .sidebar-badge,
      & .sidebar-footer,
      & .sidebar-logo-text {
        display: none;
      }

      & .sidebar-link {
        justify-content: center;
        padding: 0.5rem;
        gap: 0;
      }
      & .sidebar-header {
        justify-content: center;
        padding: 0.75rem 0.5rem;
      }
      & .sidebar-group > summary {
        justify-content: center;
      }
      & .sidebar-group > summary span:not(.sidebar-icon, .sidebar-dot) {
        display: none;
      }
      & .sidebar-group > summary > svg:last-child {
        display: none;
      }

      /* The nested-nav indent (0.75rem) would offset submenu icons from the
         rail column - drop it while collapsed. */
      & .sidebar-group > .sidebar-nav {
        padding-left: 0;
      }

      /* Submenu summary (e.g. Settings/cog) is NOT a .sidebar-link - it needs
         the same centering or its icon drifts off the icon column. Expanded
         submenu items have no icons, so the nav stays hidden while collapsed. */
      & .sidebar-submenu > summary {
        justify-content: center;
        padding: 0.5rem;
        gap: 0;
      }
      & .sidebar-submenu > summary span:not(.sidebar-icon, .sidebar-dot) {
        display: none;
      }
      & .sidebar-submenu > summary > svg:last-child {
        display: none;
      }
      & .sidebar-submenu > .sidebar-nav {
        display: none;
      }
    }

    /* Hidden on mobile by default - shown via dialog */
    @media (max-width: 767px) {
      display: none;
    }
  }

  /* ── Sidebar header ───────────────────────────────────────── */
  .sidebar-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sidebar-foreground);
    text-decoration: none;
  }

  /* ── Sidebar content (scrollable area) ────────────────────── */
  .sidebar-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.5rem;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-border) transparent;
  }

  /* ── Sidebar nav ──────────────────────────────────────────── */
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }

  /* ── Nav links ────────────────────────────────────────────── */
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--sidebar-foreground);
    text-decoration: none;
    transition: background-color 150ms ease;
    position: relative;

    &:hover {
      background-color: var(--sidebar-accent);
      color: var(--sidebar-accent-foreground);
    }

    &[data-active="true"],
    &[aria-current="page"] {
      background-color: var(--sidebar-accent);
      color: var(--sidebar-accent-foreground);
      font-weight: 500;
    }

    &:focus-visible {
      outline: 2px solid var(--sidebar-ring);
      outline-offset: -2px;
    }

    & svg {
      width: 1rem;
      height: 1rem;
      flex-shrink: 0;
    }
  }

  /* ── Menu badge ───────────────────────────────────────────── */
  .sidebar-badge {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    background-color: var(--sidebar-primary);
    color: var(--sidebar-primary-foreground);
    line-height: 1;
  }

  /* ── Leading icon / emoji ─────────────────────────────────── */
  /* <span class="sidebar-icon"> in front of a link, submenu or group label:
     holds an <svg> or an emoji in a fixed 1rem box, so labels line up and
     the collapsed rail keeps showing it. */
  .sidebar-icon {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    font-size: 0.9375rem;
    font-style: normal;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;

    & svg {
      width: 1rem;
      height: 1rem;
    }
  }
  .sidebar-group > summary .sidebar-icon {
    width: 0.875rem;
    height: 0.875rem;
    font-size: 0.8125rem;
  }
  .sidebar-group > summary .sidebar-icon svg {
    width: 0.875rem;
    height: 0.875rem;
  }

  /* ── Activity dot ─────────────────────────────────────────── */
  /* <span class="sidebar-dot"> at the end of a link / summary marks news or
     activity (name it: role="img" aria-label="New"). Colors via data-variant,
     a ping via data-animate="ping"; on the collapsed rail it sits on the
     icon's corner. */
  .sidebar-dot {
    --_c: var(--sidebar-primary);
    position: relative;
    width: 0.5rem;
    height: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    border-radius: 999px;
    background-color: var(--_c);

    &[data-variant="destructive"] {
      --_c: var(--destructive);
    }
    &[data-variant="success"] {
      --_c: oklch(0.65 0.17 150);
    }
    &[data-variant="warning"] {
      --_c: oklch(0.78 0.16 75);
    }
    &[data-variant="info"] {
      --_c: oklch(0.62 0.17 250);
    }

    &[data-animate="ping"]::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background-color: var(--_c);
      animation: sidebar-dot-ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
    }
  }
  @keyframes sidebar-dot-ping {
    75%,
    100% {
      scale: 2.4;
      opacity: 0;
    }
  }
  /* dot + badge / dot + chevron share the pushed-right slot - a hidden dot (news this reader has seen) leaves
     the slot to the badge or the chevron */
  .sidebar-badge + .sidebar-dot,
  .sidebar-dot:not([hidden]) + .sidebar-badge,
  :is(.sidebar-group, .sidebar-submenu) > summary > .sidebar-dot:not([hidden]) ~ svg:last-child {
    margin-left: 0;
  }
  .app-sidebar[data-state="collapsed"] {
    & :is(.sidebar-group, .sidebar-submenu) > summary {
      position: relative;
    }
    & .sidebar-dot {
      position: absolute;
      top: 0.3125rem;
      right: 0.3125rem;
      margin: 0;
      width: 0.4375rem;
      height: 0.4375rem;
    }
  }

  /* ── Section title ────────────────────────────────────────── */
  .sidebar-section-title {
    padding: 0.75rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
  }

  /* ── Collapsible group (uses <details>) ────────────────────── */
  .sidebar-group {
    & > summary {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      font-size: 0.6875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted-foreground);
      cursor: pointer;
      list-style: none;
      border-radius: var(--radius-md);
      transition: background-color 150ms ease;

      &:hover {
        background-color: var(--sidebar-accent);
      }
      &::-webkit-details-marker {
        display: none;
      }

      & > svg:last-child {
        width: 0.875rem;
        height: 0.875rem;
        margin-left: auto;
        transition: rotate 200ms ease;
      }
    }

    &[open] > summary > svg:last-child {
      rotate: 90deg;
    }
    & > .sidebar-nav {
      padding: 0.25rem 0 0.25rem 0.75rem;
    }
  }

  /* ── Submenu (nested <details>) ────────────────────────────── */
  .sidebar-submenu {
    & > summary {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 0.75rem;
      border-radius: var(--radius-md);
      font-size: 0.875rem;
      color: var(--sidebar-foreground);
      cursor: pointer;
      list-style: none;
      transition: background-color 150ms ease;

      /* leading icon matches .sidebar-link's 1rem - otherwise lucide's
         24px default renders the cog larger than the nav icons */
      & > svg:first-child {
        width: 1rem;
        height: 1rem;
        flex-shrink: 0;
      }

      &:hover {
        background-color: var(--sidebar-accent);
        color: var(--sidebar-accent-foreground);
      }
      &::-webkit-details-marker {
        display: none;
      }

      & > svg:last-child {
        width: 0.875rem;
        height: 0.875rem;
        margin-left: auto;
        transition: rotate 200ms ease;
      }
    }

    &[open] > summary > svg:last-child {
      rotate: 90deg;
    }

    & > .sidebar-nav {
      padding: 0.25rem 0 0.25rem 1.5rem;
      border-left: 1px solid var(--sidebar-border);
      margin-left: 0.75rem;
    }
  }

  /* ── Group action button ──────────────────────────────────── */
  .sidebar-group-action {
    margin-left: auto;
    padding: 0.125rem;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: var(--radius-sm);

    &:hover {
      color: var(--sidebar-foreground);
      background-color: var(--sidebar-accent);
    }
    & svg {
      width: 0.875rem;
      height: 0.875rem;
    }
  }

  /* ── Sidebar footer ───────────────────────────────────────── */
  .sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.8125rem;
    color: var(--sidebar-foreground);
    flex-shrink: 0;
    & p {
      margin: 0;
    }
  }

  /* ── Sidebar trigger ──────────────────────────────────────── */
  .sidebar-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    border-radius: var(--radius-md);

    &:hover {
      background-color: var(--accent);
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }
    & svg {
      width: 1rem;
      height: 1rem;
    }
  }

  /* ── Mobile sidebar (<dialog> sheet overlay) ──────────────── */
  .sidebar-mobile {
    border: none;
    padding: 0;
    margin: 0;
    position: fixed;
    inset: 0;
    width: var(--sidebar-width, 16rem);
    max-width: 80vw;
    height: 100%;
    background-color: var(--sidebar);
    color: var(--sidebar-foreground);
    z-index: 50;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    opacity: 0;
    translate: -100% 0;
    transition:
      opacity 200ms ease,
      translate 200ms ease,
      display 200ms allow-discrete;

    &[open] {
      opacity: 1;
      translate: 0 0;
    }

    &[data-side="right"] {
      right: 0;
      left: auto;
      translate: 100% 0;
      &[open] {
        translate: 0 0;
      }
    }

    &::backdrop {
      background: oklch(0 0 0 / 0.5);
      opacity: 0;
      transition:
        opacity 200ms ease,
        display 200ms allow-discrete;
    }

    &[open]::backdrop {
      opacity: 1;
    }

    & .sidebar-mobile-close {
      position: absolute;
      top: 0.75rem;
      right: 0.75rem;
      width: 1.5rem;
      height: 1.5rem;
      border: none;
      background: transparent;
      color: var(--sidebar-foreground);
      cursor: pointer;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;

      &:hover {
        background-color: var(--sidebar-accent);
      }
      & svg {
        width: 0.875rem;
        height: 0.875rem;
      }
    }

    @media (min-width: 768px) {
      display: none;
    }
  }

  @starting-style {
    .sidebar-mobile[open] {
      opacity: 0;
      translate: -100% 0;
    }
    .sidebar-mobile[open]::backdrop {
      opacity: 0;
    }
    .sidebar-mobile[data-side="right"][open] {
      opacity: 0;
      translate: 100% 0;
    }
  }

  /* ── Scroll lock ──────────────────────────────────────────── */
  /* Page behind stays put while the mobile sheet is modal (see dialog.css):
     `:modal` + overflow:hidden freezes the viewport at its current offset. */
  html:has(.sidebar-mobile:modal) {
    overflow: hidden;
    scrollbar-gutter: stable;
  }

  /* ── Reduced motion ───────────────────────────────────────── */
  @media (prefers-reduced-motion: reduce) {
    .app-sidebar {
      transition: none;
    }
    .sidebar-link {
      transition: none;
    }
    .sidebar-group > summary > svg:last-child {
      transition: none;
    }
    .sidebar-submenu > summary > svg:last-child {
      transition: none;
    }
    .sidebar-dot[data-animate]::after {
      animation: none;
    }
    .sidebar-mobile {
      transition: none;
    }
    .sidebar-mobile::backdrop {
      transition: none;
    }
  }
  /* -- Density ----------------------------------------------------
     data-density on the .app-sidebar root scales link rows and the content
     frame. comfortable == the unsized default (0.5rem). Independent of the
     collapsed rail, whose compact paddings win by higher specificity. */
  .app-sidebar:where([data-density="compact"]) {
    & .sidebar-link {
      padding-block: 0.375rem;
    }
    & .sidebar-content {
      padding: 0.375rem;
      gap: 0.375rem;
    }
  }
  .app-sidebar:where([data-density="comfortable"]) {
    & .sidebar-link {
      padding-block: 0.5rem;
    }
    & .sidebar-content {
      padding: 0.5rem;
      gap: 0.5rem;
    }
  }
  .app-sidebar:where([data-density="spacious"]) {
    & .sidebar-link {
      padding-block: 0.625rem;
    }
    & .sidebar-content {
      padding: 0.625rem;
      gap: 0.625rem;
    }
  }
}

/* ── components/slider/slider.css ── */
/* -- Slider component ------------------------------------------- */

@layer components {
  /* Everything runs through a few private variables so a .slider-range
     wrapper (two thumbs) can hand its size and color down to both inputs:
     --_track / --_thumb (set by data-size, on the slider or on the range),
     --_c (set by data-tone) and the public --slider-color for any color.
     --_fill resolves them once, here, on the input. */
  .slider {
    --slider-value: 50%;
    --_fill: var(--_c, var(--slider-color, var(--primary)));
    --_t: var(--_track, 0.5rem);
    --_d: var(--_thumb, 1.25rem);
    --_dir: to right;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    /* the UA gives a range a 2px margin: with width 100% the track would
       overflow its box and drift off a .slider-marks scale */
    margin-inline: 0;
    height: var(--_t);
    border-radius: 9999px;
    background: var(--secondary);
    cursor: pointer;
    outline: none;
    border: none;
    accent-color: var(--_fill);

    /* Track - WebKit (filled via gradient) */
    &::-webkit-slider-runnable-track {
      height: var(--_t);
      border-radius: 9999px;
      background: linear-gradient(
        var(--_dir),
        var(--_fill) 0%,
        var(--_fill) var(--slider-value),
        var(--secondary) var(--slider-value),
        var(--secondary) 100%
      );
    }

    /* Track - Firefox */
    &::-moz-range-track {
      height: var(--_t);
      border-radius: 9999px;
      background: var(--secondary);
      border: none;
    }

    /* Filled portion - Firefox */
    &::-moz-range-progress {
      height: var(--_t);
      border-radius: 9999px;
      background: var(--_fill);
    }

    /* Thumb - WebKit (re-centered on the track: (track - thumb) / 2).
       --slider-thumb-image paints a picture (an emoji, see data-thumb) */
    &::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: var(--_d);
      height: var(--_d);
      border-radius: 50%;
      background:
        var(--slider-thumb-image, none) center / 100% no-repeat,
        var(--background);
      border: 2px solid var(--_fill);
      margin-top: calc((var(--_t) - var(--_d)) / 2);
      cursor: pointer;
      transition:
        box-shadow 150ms,
        scale 150ms;
    }

    /* Thumb - Firefox */
    &::-moz-range-thumb {
      width: var(--_d);
      height: var(--_d);
      border-radius: 50%;
      background:
        var(--slider-thumb-image, none) center / 100% no-repeat,
        var(--background);
      border: 2px solid var(--_fill);
      cursor: pointer;
      transition:
        box-shadow 150ms,
        scale 150ms;
    }

    /* Hover */
    &:hover:not(:disabled) {
      &::-webkit-slider-thumb {
        box-shadow: 0 0 0 4px color-mix(in oklch, var(--_fill) 15%, transparent);
      }
      &::-moz-range-thumb {
        box-shadow: 0 0 0 4px color-mix(in oklch, var(--_fill) 15%, transparent);
      }
    }

    /* Focus */
    &:focus-visible {
      &::-webkit-slider-thumb {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
      }
      &::-moz-range-thumb {
        outline: 2px solid var(--ring);
        outline-offset: 2px;
      }
    }

    /* Disabled */
    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;

      &::-webkit-slider-thumb {
        cursor: not-allowed;
      }
      &::-moz-range-thumb {
        cursor: not-allowed;
      }
    }

    /* RTL: the range runs right to left, so does the fill */
    &:dir(rtl) {
      --_dir: to left;
    }

    /* Vertical orientation */
    &[data-orientation="vertical"] {
      --_dir: to top;
      writing-mode: vertical-lr;
      direction: rtl;
      width: var(--_t);
      height: 12rem;

      &::-webkit-slider-runnable-track {
        width: var(--_t);
        height: auto;
      }
      &::-webkit-slider-thumb {
        margin-top: 0;
        margin-left: calc((var(--_t) - var(--_d)) / 2);
      }
    }

    /* -- Emoji thumb: data-thumb="emoji" (slider.js draws the emoji from
       data-thumb-emoji into --slider-thumb-image) - no ring, no fill disc,
       a bit larger than the plain thumb. */
    &[data-thumb="emoji"] {
      --_d: var(--_thumb, 2rem);

      &::-webkit-slider-thumb {
        border: 0;
        background-color: transparent;
      }
      &::-moz-range-thumb {
        border: 0;
        background-color: transparent;
      }
      &:active::-webkit-slider-thumb {
        scale: 1.15;
      }
      &:active::-moz-range-thumb {
        scale: 1.15;
      }
    }
  }

  /* -- Sizes: track thickness + thumb diameter (md == the default) ----
     On a .slider or on a .slider-range (both inputs inherit). */
  :is(.slider, .slider-range, .slider-marks) {
    &[data-size="xs"] {
      --_track: 0.25rem;
      --_thumb: 0.75rem;
    }
    &[data-size="sm"] {
      --_track: 0.375rem;
      --_thumb: 1rem;
    }
    &[data-size="md"] {
      --_track: 0.5rem;
      --_thumb: 1.25rem;
    }
    &[data-size="lg"] {
      --_track: 0.625rem;
      --_thumb: 1.5rem;
    }
    &[data-size="xl"] {
      --_track: 0.75rem;
      --_thumb: 1.75rem;
    }

    /* -- Tones: success / warning / info / destructive; any other color
       via style="--slider-color: …" */
    &[data-tone="success"] {
      --_c: oklch(0.6 0.15 150);
    }
    &[data-tone="warning"] {
      --_c: oklch(0.78 0.16 75);
    }
    &[data-tone="info"] {
      --_c: oklch(0.6 0.16 250);
    }
    &[data-tone="destructive"] {
      --_c: var(--destructive);
    }
  }

  /* -- Marks: a CSS-only tick scale under a stepped slider ------------
     <div class="slider-marks" aria-hidden="true"> right after the slider
     (or range); each child is a zero-width flex item, so space-between
     lands the tick centres on the thumb-centre travel (inset by half a
     thumb at each end). The tick is generated, the child's text is the
     optional label. It follows the slider's data-size when it is the
     slider's next sibling (or set data-size on the marks). */
  .slider-marks {
    display: flex;
    justify-content: space-between;
    padding-inline: calc(var(--_thumb, 1.25rem) / 2);
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);

    & > * {
      /* zero-width: flex-basis 0 alone leaves min-width:auto, which would
         widen the item to its label and push the tick off its step */
      flex: 0 0 0;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.25rem;
      white-space: nowrap;
    }
    & > *::before {
      content: "";
      width: 1px;
      height: 0.375rem;
      background: var(--border);
    }
    /* a tick without a label (an empty child) stays a short tick */
    & > :empty::before {
      height: 0.25rem;
    }
  }
  :is(.slider, .slider-range)[data-size="xs"] + .slider-marks:not([data-size]) {
    --_thumb: 0.75rem;
  }
  :is(.slider, .slider-range)[data-size="sm"] + .slider-marks:not([data-size]) {
    --_thumb: 1rem;
  }
  :is(.slider, .slider-range)[data-size="lg"] + .slider-marks:not([data-size]) {
    --_thumb: 1.5rem;
  }
  :is(.slider, .slider-range)[data-size="xl"] + .slider-marks:not([data-size]) {
    --_thumb: 1.75rem;
  }

  /* -- Range: two thumbs on one track ---------------------------------
     Two .slider inputs stacked in a .slider-range; only their thumbs take
     the pointer, the wrapper paints one track with the span between the
     thumbs filled (slider.js keeps --range-from / --range-to in sync and
     the low value <= the high one). Each input keeps its own keyboard,
     label and State API. */
  .slider-range {
    --range-from: 25%;
    --range-to: 75%;
    --_fill: var(--_c, var(--slider-color, var(--primary)));
    --_dir: to right;
    position: relative;
    display: block;
    width: 100%;
    height: var(--_thumb, 1.25rem);

    &::before {
      content: "";
      position: absolute;
      inset-inline: 0;
      top: 50%;
      height: var(--_track, 0.5rem);
      translate: 0 -50%;
      border-radius: 9999px;
      background: linear-gradient(
        var(--_dir),
        var(--secondary) var(--range-from),
        var(--_fill) var(--range-from),
        var(--_fill) var(--range-to),
        var(--secondary) var(--range-to)
      );
    }
    &:dir(rtl) {
      --_dir: to left;
    }

    & > .slider {
      position: absolute;
      inset-inline: 0;
      top: 50%;
      translate: 0 -50%;
      margin: 0;
      background: none;
      pointer-events: none;

      &::-webkit-slider-runnable-track {
        background: none;
      }
      &::-moz-range-track {
        background: none;
      }
      &::-moz-range-progress {
        background: none;
      }
      &::-webkit-slider-thumb {
        pointer-events: auto;
      }
      &::-moz-range-thumb {
        pointer-events: auto;
      }
    }
    /* the thumb last moved stays on top (both can reach the same value) */
    & > .slider[data-active] {
      z-index: 1;
    }

    &:has(.slider:disabled) {
      opacity: 0.5;
    }
  }

  /* -- Field: icons, emojis and values around a slider ----------------- */
  .slider-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;

    & > :is(.slider, .slider-range) {
      flex: 1 1 auto;
      min-width: 0;
    }
  }
  .slider-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.125rem;
    line-height: 1;
    color: var(--muted-foreground);

    & svg {
      width: 1.125rem;
      height: 1.25rem;
    }
  }
  .slider-value {
    flex-shrink: 0;
    min-width: 3.5em;
    text-align: end;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
  }
  /* a scale under the track: the first and last labels align to the ends */
  .slider-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted-foreground);
  }

  /* Reduced motion */
  @media (prefers-reduced-motion: reduce) {
    .slider {
      &::-webkit-slider-thumb {
        transition: none;
      }
      &::-moz-range-thumb {
        transition: none;
      }
    }
  }

  /* High contrast */
  @media (prefers-contrast: more) {
    .slider-marks {
      color: var(--foreground);
      & > *::before {
        background: var(--foreground);
      }
    }
    .slider {
      &::-webkit-slider-thumb {
        border-width: 3px;
      }
      &::-moz-range-thumb {
        border-width: 3px;
      }
    }
  }

  /* Forced colors (Windows High Contrast Mode) */
  @media (forced-colors: active) {
    .slider-marks {
      color: CanvasText;
      & > *::before {
        background: CanvasText;
      }
    }
    .slider {
      &::-webkit-slider-runnable-track {
        background: ButtonFace;
        border: 1px solid ButtonText;
      }
      &::-moz-range-track {
        background: ButtonFace;
        border: 1px solid ButtonText;
      }
      &::-moz-range-progress {
        background: Highlight;
      }
      &::-webkit-slider-thumb {
        background: ButtonText;
        border-color: ButtonText;
      }
      &::-moz-range-thumb {
        background: ButtonText;
        border-color: ButtonText;
      }

      &:focus-visible {
        &::-webkit-slider-thumb {
          outline-color: Highlight;
        }
        &::-moz-range-thumb {
          outline-color: Highlight;
        }
      }
    }
    .slider-range::before {
      background: Highlight;
    }
  }
}

/* ── components/spinner/spinner.css ── */
@layer components {
  .spinner {
    width: 1rem;
    height: 1rem;
    animation: spinner-rotate 1s linear infinite;
    color: var(--muted-foreground);
    flex-shrink: 0;

    &[data-size="xs"] {
      width: 0.625rem;
      height: 0.625rem;
    }

    &[data-size="sm"] {
      width: 0.875rem;
      height: 0.875rem;
    }

    &[data-size="md"] {
      width: 1.25rem;
      height: 1.25rem;
    }

    &[data-size="lg"] {
      width: 1.5rem;
      height: 1.5rem;
    }

    &[data-size="xl"] {
      width: 2rem;
      height: 2rem;
    }
  }

  @keyframes spinner-rotate {
    to {
      transform: rotate(360deg);
    }
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .spinner,
    .spinner *,
    .spinner::before,
    .spinner::after,
    .spinner *::before,
    .spinner *::after,
    .spinner::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/swap/swap.css ── */
/* -- Swap component -------------------------------------------- */

@layer components {
  .swap {
    /* the faces stack in one grid cell, so the box sizes to the widest one
       and no absolute positioning / JS measurement is needed */
    position: relative;
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    color: var(--foreground);
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    /* flip needs depth; harmless for the other variants */
    perspective: 40rem;

    /* the checkbox IS the state — visually hidden but focusable and
       hit-testable across the whole control (no .sr-only dependency) */
    & > input[type="checkbox"] {
      grid-area: 1 / 1;
      appearance: none;
      -webkit-appearance: none;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      opacity: 0;
      cursor: inherit;
    }

    & .swap-on,
    & .swap-off,
    & .swap-indeterminate {
      grid-area: 1 / 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      backface-visibility: hidden;
      transition:
        opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
        rotate 300ms cubic-bezier(0.4, 0, 0.2, 1),
        scale 300ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    & svg:not([class*="size-"]) {
      width: 1.25rem;
      height: 1.25rem;
      flex-shrink: 0;
    }

    /* -- Faces: default (off) ------------------------------- */
    & .swap-off {
      opacity: 1;
    }

    /* -- Faces: indeterminate ------------------------------- */
    &:has(> input:indeterminate) {
      & .swap-off {
        opacity: 0;
      }
      & .swap-indeterminate {
        opacity: 1;
      }
    }

    /* -- Faces: on (checked, or forced via data-active) ------ */
    &:has(> input:checked),
    &[data-active] {
      & .swap-off,
      & .swap-indeterminate {
        opacity: 0;
      }
      & .swap-on {
        opacity: 1;
      }
    }

    /* -- Variant: rotate ------------------------------------ */
    &[data-variant="rotate"] {
      & .swap-on,
      & .swap-indeterminate {
        rotate: -45deg;
      }

      &:has(> input:indeterminate) {
        & .swap-off {
          rotate: 45deg;
        }
        & .swap-indeterminate {
          rotate: 0deg;
        }
      }

      &:has(> input:checked),
      &[data-active] {
        & .swap-off,
        & .swap-indeterminate {
          rotate: 45deg;
        }
        & .swap-on {
          rotate: 0deg;
        }
      }
    }

    /* -- Variant: flip -------------------------------------- */
    &[data-variant="flip"] {
      & .swap-on,
      & .swap-indeterminate {
        rotate: y 180deg;
      }

      &:has(> input:indeterminate) {
        & .swap-off {
          rotate: y -180deg;
        }
        & .swap-indeterminate {
          rotate: y 0deg;
        }
      }

      &:has(> input:checked),
      &[data-active] {
        & .swap-off,
        & .swap-indeterminate {
          rotate: y -180deg;
        }
        & .swap-on {
          rotate: y 0deg;
        }
      }
    }

    /* -- Sizes ---------------------------------------------- */
    &[data-size="sm"] {
      min-width: 2rem;
      min-height: 2rem;
      font-size: 0.75rem;

      & svg:not([class*="size-"]) {
        width: 1rem;
        height: 1rem;
      }
    }

    &[data-size="lg"] {
      min-width: 2.75rem;
      min-height: 2.75rem;
      font-size: 1.125rem;

      & svg:not([class*="size-"]) {
        width: 1.5rem;
        height: 1.5rem;
      }
    }

    /* -- Interaction states --------------------------------- */
    &:hover:not(:has(> input:disabled)) {
      background-color: var(--accent);
      color: var(--accent-foreground);
    }

    &:has(> input:focus-visible) {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    /* a disabled input never toggles - no pointer-events: none, so the
       not-allowed cursor shows */
    &:has(> input:disabled) {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }

  /* Accessibility: honour a reduced-motion request — the faces still swap,
     they just do not animate (near-zero duration keeps transitionend firing). */
  @media (prefers-reduced-motion: reduce) {
    .swap .swap-on,
    .swap .swap-off,
    .swap .swap-indeterminate {
      transition-duration: 0.01ms !important;
    }
  }

  @media (prefers-contrast: more) {
    .swap {
      border: 2px solid transparent;

      &:has(> input:checked),
      &[data-active] {
        border-color: currentColor;
      }
    }
  }

  @media (forced-colors: active) {
    .swap {
      border: 1px solid ButtonText;
      color: ButtonText;
      forced-color-adjust: none;

      &:has(> input:checked),
      &[data-active] {
        background: Highlight;
        color: HighlightText;
      }

      &:has(> input:disabled) {
        border-color: GrayText;
        color: GrayText;
      }
    }
  }
}

/* ── components/switch/switch.css ── */
/* -- Switch component ------------------------------------------- */

@layer components {
  .switch {
    appearance: none;
    margin: 0; /* kill the UA's ~4px input margin - breaks flex/grid rhythm */
    width: 2.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: var(--input);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background-color 150ms;
    border: none;
    outline: none;

    /* Thumb */
    &::after {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: calc(1.25rem - 4px);
      height: calc(1.25rem - 4px);
      border-radius: 50%;
      background: var(--background);
      transition: transform 150ms;
      box-shadow: 0 1px 2px oklch(0 0 0 / 0.15);
    }

    &:checked {
      background: var(--primary);

      &::after {
        transform: translateX(1rem);
      }
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    /* Disabled = legible but inert: never an opacity fade (0.5 on a light
       --border edge left a ghost you had to look for). The shape keeps its
       full-strength edge, the surface turns muted, a chosen state keeps a
       softened primary fill, and the label goes muted with the no-entry
       cursor - "a choice that exists but is unavailable right now". */
    &:disabled {
      cursor: not-allowed;
      /* the off track keeps its full --input shade; an edge ring holds the
         outline even where --input sits close to the page */
      box-shadow: inset 0 0 0 1px var(--border);

      &::after {
        background: var(--muted);
        box-shadow: 0 0 0 1px var(--border);
      }

      &:checked {
        background: color-mix(in oklch, var(--primary) 45%, var(--background));
        box-shadow: none;

        &::after {
          background: var(--background);
          box-shadow: none;
        }
      }
    }

    &[aria-invalid="true"] {
      background: var(--destructive);

      &:checked {
        background: var(--destructive);
      }
    }

    /* -- Sizes ----------------------------------------------- */
    &[data-size="xs"] {
      width: 1.5rem;
      height: 0.875rem;

      &::after {
        width: calc(0.875rem - 4px);
        height: calc(0.875rem - 4px);
      }

      &:checked::after {
        transform: translateX(0.625rem);
      }
    }

    &[data-size="sm"] {
      width: 1.75rem;
      height: 1rem;

      &::after {
        width: calc(1rem - 4px);
        height: calc(1rem - 4px);
      }

      &:checked::after {
        transform: translateX(0.75rem);
      }
    }

    &[data-size="md"] {
      /* same as the default - explicit member of the scale */
    }

    &[data-size="lg"] {
      width: 2.75rem;
      height: 1.5rem;

      &::after {
        width: calc(1.5rem - 4px);
        height: calc(1.5rem - 4px);
      }

      &:checked::after {
        transform: translateX(1.25rem);
      }
    }

    &[data-size="xl"] {
      width: 3.25rem;
      height: 1.75rem;

      &::after {
        width: calc(1.75rem - 4px);
        height: calc(1.75rem - 4px);
      }

      &:checked::after {
        transform: translateX(1.5rem);
      }
    }
  }

  /* -- Switch item layout ----------------------------------- */
  .switch-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    & > label {
      font-size: 0.875rem;
      cursor: pointer;
    }
  }

  /* With-description layout: label + description stack beside the switch.
     The switch spans both rows, so grid auto-placement (definite-row items
     first) pins it to column 1 - the track template must therefore lead with
     the auto (switch) track. `1fr auto` here once placed the text in the far
     right track (reported: "description renders on the far right"). */
  .switch-item-block {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 0.75rem;
    align-items: center;

    & > .switch {
      grid-row: 1 / 3;
    }

    & > label {
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
    }

    & > .switch-description {
      font-size: 0.8125rem;
      color: var(--muted-foreground);
      line-height: 1.5;
    }
  }

  /* Gap hit area: inside an item layout the control's click target spans
     the gap to its label (a transparent ::before, part of the input's own
     hit box), so clicking the whitespace between control and text toggles
     too - the label's `for` covers the text itself. Inline-end only: the
     label always sits after the control (block layouts place it in the
     second grid column). */
  :is(.switch-item) > .switch::before {
    content: "";
    position: absolute;
    inset-block: -0.25rem;
    inset-inline: -0.25rem calc(-1 * 0.5rem);
  }

  :is(.switch-item-block) > .switch::before {
    content: "";
    position: absolute;
    inset-block: -0.25rem;
    inset-inline: -0.25rem calc(-1 * 0.75rem);
  }

  /* Label disabled styling via :has() */
  .switch-item:has(.switch:disabled),
  .switch-item-block:has(.switch:disabled) {
    cursor: not-allowed;

    /* the words say "unavailable" too - no hand pointer over a label whose
       click cannot flip the switch */
    & > label {
      color: var(--muted-foreground);
      cursor: not-allowed;
    }
  }

  /* -- Accessibility ---------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .switch,
    .switch::after {
      transition: none;
    }
  }

  @media (forced-colors: active) {
    .switch {
      background: ButtonFace;
      border: 1px solid ButtonText;

      &::after {
        background: ButtonText;
        box-shadow: none;
      }

      &:checked {
        background: Highlight;
        border-color: Highlight;

        &::after {
          background: HighlightText;
        }
      }

      &:disabled {
        border-color: GrayText;

        &::after {
          background: GrayText;
        }
      }
    }
  }
}

/* ── components/table/table.css ── */
@layer components {
  .table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    container-type: inline-size;
  }

  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    caption-side: bottom;
  }

  .table-caption {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-align: center;
  }

  .table-head {
    padding: 0.75rem 1rem;
    /* explicit: a th's UA default centers unless the table sets a non-initial alignment */
    text-align: start;
    font-weight: 500;
    color: var(--muted-foreground);
    background-color: var(--muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);

    &:first-child {
      border-top-left-radius: var(--radius-lg);
    }

    &:last-child {
      border-top-right-radius: var(--radius-lg);
    }
  }

  .table-row {
    border-bottom: 1px solid var(--border);
    transition: background-color 150ms ease;

    &:last-child {
      border-bottom: none;
    }

    tbody &:hover {
      background-color: var(--muted);
    }
  }

  .table-cell {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: var(--foreground);

    /* a row header (<th scope="row">) reads like a cell: start-aligned,
       not the UA's centered th */
    &:is(th) {
      text-align: start;
      font-weight: 500;
    }
  }

  tfoot .table-row {
    background-color: var(--muted);
    border-top: 1px solid var(--border);
    font-weight: 500;
  }

  tfoot .table-cell:first-child {
    border-bottom-left-radius: var(--radius-lg);
  }

  tfoot .table-cell:last-child {
    border-bottom-right-radius: var(--radius-lg);
  }

  /* -- Density ----------------------------------------------------
     data-density on the .table root scales cell/head/caption padding.
     Scale matches sizing.css (0.75 / 1 / 1.25): comfortable == the unsized
     default (0.75rem 1rem), compact 0.375rem 0.625rem, spacious 1rem 1.25rem.
     :where() gives these (0,2,0) - an explicit density always beats the
     automatic narrow-container compaction below. */
  .table:where([data-density="compact"]) {
    & .table-head,
    & .table-cell {
      padding: 0.375rem 0.625rem;
    }
    & .table-caption {
      padding: 0.5rem 0.625rem;
    }
  }
  .table:where([data-density="comfortable"]) {
    & .table-head,
    & .table-cell {
      padding: 0.75rem 1rem;
    }
    & .table-caption {
      padding: 0.75rem 1rem;
    }
  }
  .table:where([data-density="spacious"]) {
    & .table-head,
    & .table-cell {
      padding: 1rem 1.25rem;
    }
    & .table-caption {
      padding: 1rem 1.25rem;
    }
  }

  /* -- Alignment: data-align on a th / td (start / center / end);
     data-numeric: end-aligned tabular figures (amounts, counts) ---------- */
  :is(.table-head, .table-cell) {
    &[data-align="start"] {
      text-align: start;
    }
    &[data-align="center"] {
      text-align: center;
    }
    &[data-align="end"] {
      text-align: end;
    }
    &[data-numeric] {
      text-align: end;
      font-variant-numeric: tabular-nums;
    }
    &[data-valign="top"] {
      vertical-align: top;
    }
    &[data-nowrap] {
      white-space: nowrap;
    }
  }
  .table {
    text-align: start;
  }

  /* -- Sorting: a .table-sort button in the header; aria-sort on the th
     (ascending / descending) draws the arrow, table.js sorts the rows ---- */
  .table-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin: -0.25rem -0.5rem;
    padding: 0.25rem 0.5rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;

    &:hover {
      color: var(--foreground);
      background-color: color-mix(in oklch, var(--foreground) 6%, transparent);
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 1px;
    }
    /* the arrow: both halves muted while unsorted, one strong when sorted */
    &::after {
      content: "";
      width: 0.5rem;
      height: 0.75rem;
      flex-shrink: 0;
      background:
        conic-gradient(from 150deg at 50% 0, currentColor 60deg, transparent 0) top / 100% 40% no-repeat,
        conic-gradient(from -30deg at 50% 100%, currentColor 60deg, transparent 0) bottom / 100% 40% no-repeat;
      opacity: 0.35;
    }
    [data-align="end"] > &,
    [data-numeric] > & {
      flex-direction: row-reverse;
    }
  }
  .table-head[aria-sort="ascending"] .table-sort::after {
    opacity: 1;
    background: conic-gradient(from 150deg at 50% 0, currentColor 60deg, transparent 0) center / 100% 50% no-repeat;
  }
  .table-head[aria-sort="descending"] .table-sort::after {
    opacity: 1;
    background: conic-gradient(from -30deg at 50% 100%, currentColor 60deg, transparent 0) center / 100% 50% no-repeat;
  }
  .table-head[aria-sort]:not([aria-sort="none"]) {
    color: var(--foreground);
  }

  /* -- Selection: a leading .table-select cell with a checkbox (the header
     one selects all); a selected row is tinted -------------------------- */
  .table-select {
    width: 1%;
    padding-inline-end: 0 !important;

    & .checkbox {
      vertical-align: middle;
    }
  }
  .table-row[aria-selected="true"] {
    background-color: color-mix(in oklch, var(--primary) 7%, transparent);

    tbody &:hover {
      background-color: color-mix(in oklch, var(--primary) 11%, transparent);
    }
  }

  /* -- Reordering: a .table-handle cell with a grip button; the row being
     dragged fades, a line shows where it lands -------------------------- */
  .table-handle {
    width: 1%;
    padding-inline-end: 0 !important;
    color: var(--muted-foreground);

    & button {
      display: inline-grid;
      place-items: center;
      width: 1.5rem;
      height: 1.5rem;
      padding: 0;
      border: 0;
      border-radius: var(--radius-sm);
      background: none;
      color: inherit;
      cursor: grab;

      &:hover {
        color: var(--foreground);
        background-color: var(--accent);
      }
      &:focus-visible {
        outline: 2px solid var(--ring);
        outline-offset: 1px;
      }
      & svg {
        width: 1rem;
        height: 1rem;
      }
    }
  }
  .table-row[data-dragging] {
    opacity: 0.4;
  }
  .table-row[data-drop="before"] {
    box-shadow: inset 0 2px 0 var(--primary);
  }
  .table-row[data-drop="after"] {
    box-shadow: inset 0 -2px 0 var(--primary);
  }

  /* -- Locked columns + sticky header --------------------------------------
     data-lock-start="1|2|3" on the .table keeps the first columns in view
     while the .table-container scrolls sideways (table.js measures their
     offsets into --table-lock-1 / -2); data-lock-end="1" the last column.
     data-sticky-header keeps the header row while the container scrolls
     vertically (give the container a max-height). */
  .table[data-lock-start] :is(.table-head, .table-cell),
  .table[data-lock-end] :is(.table-head, .table-cell) {
    background-clip: padding-box;
  }
  .table[data-lock-start] :is(tr > :nth-child(1)),
  .table:is([data-lock-start="2"], [data-lock-start="3"]) :is(tr > :nth-child(2)),
  .table[data-lock-start="3"] :is(tr > :nth-child(3)),
  .table[data-lock-end] :is(tr > :last-child) {
    position: sticky;
    z-index: 1;
    background-color: var(--_lock-bg, var(--background));
  }
  .table[data-lock-start] tr > :nth-child(1) {
    inset-inline-start: 0;
  }
  .table:is([data-lock-start="2"], [data-lock-start="3"]) tr > :nth-child(2) {
    inset-inline-start: var(--table-lock-1, 0px);
  }
  .table[data-lock-start="3"] tr > :nth-child(3) {
    inset-inline-start: calc(var(--table-lock-1, 0px) + var(--table-lock-2, 0px));
  }
  .table[data-lock-end] tr > :last-child {
    inset-inline-end: 0;
  }
  .table thead .table-head {
    --_lock-bg: var(--muted);
  }
  .table tfoot .table-cell {
    --_lock-bg: var(--muted);
  }
  /* the edge of the locked block casts a hairline */
  .table[data-lock-start="1"] tr > :nth-child(1),
  .table[data-lock-start="2"] tr > :nth-child(2),
  .table[data-lock-start="3"] tr > :nth-child(3) {
    box-shadow: inset -1px 0 0 var(--border);
  }
  .table[data-lock-end] tr > :last-child {
    box-shadow: inset 1px 0 0 var(--border);
  }
  .table-row:hover > :is(.table-cell) {
    --_lock-bg: color-mix(in oklch, var(--muted) 100%, var(--background));
  }
  .table-row[aria-selected="true"] > .table-cell {
    --_lock-bg: color-mix(in oklch, var(--primary) 7%, var(--background));
  }

  .table[data-sticky-header] thead .table-head {
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .table-container:has(> .table[data-sticky-header]) {
    overflow: auto;
  }

  /* -- Actions: a .table-actions cell of buttons, end-aligned - always
     visible. data-actions="quiet" on the table dims them until the row is
     hovered or focused (touch screens: full strength). On a narrow table
     (container < 40rem) the inline buttons (.table-actions-inline) give way
     to one "more" button (.table-actions-menu) opening a native popover
     menu (.table-menu) - one menu in the row, no JavaScript. Touch screens
     get 44px targets. */
  .table-actions {
    width: 1%;
    white-space: nowrap;
    text-align: end;

    & > * + *,
    & .table-actions-inline > * + * {
      margin-inline-start: 0.25rem;
    }
  }
  .table-actions-inline {
    display: inline-flex;
    align-items: center;
  }
  .table-actions-menu {
    display: none;
  }
  .table[data-actions="quiet"] :is(.table-actions > .btn, .table-actions-inline, .table-actions-menu > .btn) {
    opacity: 0.45;
    transition: opacity 150ms ease;
  }
  .table[data-actions="quiet"]
    .table-row:is(:hover, :focus-within)
    :is(.table-actions > .btn, .table-actions-inline, .table-actions-menu > .btn) {
    opacity: 1;
  }
  @media (hover: none) {
    .table[data-actions="quiet"] :is(.table-actions > .btn, .table-actions-inline, .table-actions-menu > .btn) {
      opacity: 1;
    }
  }
  @media (pointer: coarse) {
    .table-actions .btn[data-size^="icon"] {
      min-width: 2.75rem;
      min-height: 2.75rem;
    }
  }
  @container (max-width: 40rem) {
    .table-actions:has(.table-actions-menu) .table-actions-inline {
      display: none;
    }
    .table-actions-menu {
      display: inline-flex;
    }
  }

  /* the row menu: a popover anchored to its own "more" button */
  .table-row {
    anchor-scope: --table-row-menu;
  }
  .table-actions-menu > .btn {
    anchor-name: --table-row-menu;
  }
  .table-menu[popover] {
    position: fixed;
    position-anchor: --table-row-menu;
    inset: auto;
    top: anchor(bottom);
    right: anchor(right);
    position-try-fallbacks: flip-block;
    margin: 0.25rem 0 0;
    min-width: 10rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--popover);
    color: var(--popover-foreground);
    box-shadow: var(--shadow-lg);
    text-align: start;

    &:popover-open {
      display: grid;
      gap: 0.125rem;
    }
  }
  .table-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.25rem;
    padding: 0.375rem 0.625rem;
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    text-align: start;
    text-decoration: none;
    cursor: pointer;

    &:hover,
    &:focus-visible {
      background-color: var(--accent);
      color: var(--accent-foreground);
      outline: none;
    }
    &[data-tone="destructive"] {
      color: var(--destructive);
    }
    & svg {
      width: 1rem;
      height: 1rem;
    }
  }
  @media (pointer: coarse) {
    .table-menu-item {
      min-height: 2.75rem;
    }
  }

  /* -- Empty state: one .table-empty cell spanning the columns ----------- */
  .table-empty {
    padding: 2.5rem 1rem !important;
    text-align: center;
    color: var(--muted-foreground);

    & > * {
      display: block;
      margin-inline: auto;
    }
    & > * + * {
      margin-top: 0.375rem;
    }
    & > strong {
      color: var(--foreground);
      font-weight: 600;
    }
    & > .btn {
      display: inline-flex;
      margin-top: 1rem;
    }
  }
  .table-empty-icon {
    display: grid !important;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.5rem;
    border-radius: 9999px;
    background-color: var(--muted);
    color: var(--muted-foreground);

    & svg {
      width: 1.25rem;
      height: 1.25rem;
    }
  }
  tbody .table-row:has(> .table-empty):hover {
    background-color: transparent;
  }
  /* a dropdown button straight in the actions cell anchors its .table-menu too */
  .table-actions > .btn[popovertarget] {
    anchor-name: --table-row-menu;
  }

  /* -- Text in cells ------------------------------------------------------- */
  /* a plain link in a cell (a name, an id) speaks the tokens, not the UA's
     blue: the text colour, a soft underline that firms up on hover, the
     ring on keyboard focus. Classed links (.btn, a badge) keep their own. */
  .table-cell a:not([class]) {
    color: var(--foreground);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklch, currentColor 30%, transparent);
    text-underline-offset: 0.2em;
    transition: text-decoration-color 150ms ease;

    &:hover {
      text-decoration-color: currentColor;
    }
    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
      border-radius: var(--radius-sm);
    }
  }
  .table-sub {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
  }
  .table-truncate {
    display: block;
    max-width: var(--table-truncate, 14rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .table-clamp {
    display: -webkit-box;
    max-width: var(--table-clamp, 20rem);
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .table-mono {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    white-space: nowrap;
  }
  .table-muted {
    color: var(--muted-foreground);
  }

  /* -- Container query: compact table in narrow containers -- */
  @container (max-width: 480px) {
    .table-head,
    .table-cell {
      padding: 0.5rem 0.75rem;
      font-size: 0.8125rem;
    }
  }

  /* -- Print: a long table runs over pages. VERIFIED: (tmp/print-table-probe.ts + -probe2.ts, Chromium 153, A4)
     the header row repeats on every page and in every column by itself - inside this scroll wrapper too; the
     footer row repeats as well, so a total printed on every page: tfoot prints once, at the end, unless the
     table asks for a running footer (data-repeat-footer); a row taller than the rest of its page split over
     two, so rows stay whole unless data-break-inside="allow" lets them split; data-keep-last keeps the last
     three rows with the footer and with what follows the table (a totals block that sets break-before: avoid
     pulls them along), so the end never lands alone on a page. */
  @media print {
    .table-container {
      /* Chromium fragments a scroll box in print anyway; another engine may clip it */
      overflow: visible;
      /* each page's piece of the table keeps its frame */
      box-decoration-break: clone;
    }
    .table-container:has(> .table[data-sticky-header]) {
      overflow: visible;
      max-height: none;
    }
    .table[data-sticky-header] thead .table-head {
      position: static;
    }
    .table:not([data-repeat-footer]) > tfoot {
      display: table-row-group;

      & > tr:first-child {
        break-before: avoid;
      }
    }
    .table:not([data-break-inside="allow"]) tr {
      break-inside: avoid;
    }
    .table[data-keep-last] > tbody:last-of-type > tr:nth-last-child(-n + 3) {
      break-before: avoid;
    }
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .table,
    .table *,
    .table::before,
    .table::after,
    .table *::before,
    .table *::after,
    .table::backdrop,
    .table-caption,
    .table-caption *,
    .table-caption::before,
    .table-caption::after,
    .table-caption *::before,
    .table-caption *::after,
    .table-caption::backdrop,
    .table-cell,
    .table-cell *,
    .table-cell::before,
    .table-cell::after,
    .table-cell *::before,
    .table-cell *::after,
    .table-cell::backdrop,
    .table-container,
    .table-container *,
    .table-container::before,
    .table-container::after,
    .table-container *::before,
    .table-container *::after,
    .table-container::backdrop,
    .table-head,
    .table-head *,
    .table-head::before,
    .table-head::after,
    .table-head *::before,
    .table-head *::after,
    .table-head::backdrop,
    .table-row,
    .table-row *,
    .table-row::before,
    .table-row::after,
    .table-row *::before,
    .table-row *::after,
    .table-row::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/textarea/textarea.css ── */
/* -- Textarea component ----------------------------------------- */

@layer components {
  .textarea {
    /* border-box: UA gives <textarea> content-box, which would render the
       min-height 2px above the shared field frame (see .input) */
    box-sizing: border-box;
    width: 100%;
    min-height: 5rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--foreground);
    outline: none;
    box-shadow: var(--shadow-xs);
    transition:
      border-color 150ms,
      box-shadow 150ms;
    resize: vertical;
    field-sizing: content;
    line-height: 1.5;

    /* -- Rows: data-rows is the height it starts at, data-max-rows where it
       stops growing and scrolls instead (field-sizing grows it in between).
       1lh = one line of this textarea, + the padding and border. -------- */
    &[data-rows="1"] {
      min-height: calc(1lh + 1rem + 2px);
    }
    &[data-rows="2"] {
      min-height: calc(2lh + 1rem + 2px);
    }
    &[data-rows="3"] {
      min-height: calc(3lh + 1rem + 2px);
    }
    &[data-rows="4"] {
      min-height: calc(4lh + 1rem + 2px);
    }
    &[data-rows="5"] {
      min-height: calc(5lh + 1rem + 2px);
    }
    &[data-rows="6"] {
      min-height: calc(6lh + 1rem + 2px);
    }
    &[data-rows="8"] {
      min-height: calc(8lh + 1rem + 2px);
    }
    &[data-rows="10"] {
      min-height: calc(10lh + 1rem + 2px);
    }
    &[data-max-rows="2"] {
      max-height: calc(2lh + 1rem + 2px);
    }
    &[data-max-rows="3"] {
      max-height: calc(3lh + 1rem + 2px);
    }
    &[data-max-rows="4"] {
      max-height: calc(4lh + 1rem + 2px);
    }
    &[data-max-rows="5"] {
      max-height: calc(5lh + 1rem + 2px);
    }
    &[data-max-rows="6"] {
      max-height: calc(6lh + 1rem + 2px);
    }
    &[data-max-rows="8"] {
      max-height: calc(8lh + 1rem + 2px);
    }
    &[data-max-rows="10"] {
      max-height: calc(10lh + 1rem + 2px);
    }
    &[data-max-rows="12"] {
      max-height: calc(12lh + 1rem + 2px);
    }
    &[data-resize="none"] {
      resize: none;
    }

    &:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    &::placeholder {
      color: var(--muted-foreground);
    }

    /* Disabled = legible but inert: a muted surface and muted text inside
       the full-strength border - never an opacity fade that lets the box
       dissolve into the page. */
    &:disabled {
      background-color: var(--muted);
      color: var(--muted-foreground);
      box-shadow: none;
      cursor: not-allowed;
      /* resize stays off (Chrome would still let a disabled field be dragged
         taller), but the corner keeps a grip so it still reads as a text
         field - two painted diagonal strokes where the native grip sits */
      resize: none;
      background-image:
        linear-gradient(135deg, transparent 0 46%, var(--muted-foreground) 46% 54%, transparent 54%),
        linear-gradient(135deg, transparent 0 46%, var(--muted-foreground) 46% 54%, transparent 54%);
      background-repeat: no-repeat;
      background-size:
        0.625rem 0.625rem,
        0.3125rem 0.3125rem;
      background-position:
        right 0.1875rem bottom 0.1875rem,
        right 0.1875rem bottom 0.1875rem;
    }

    &:is([aria-invalid="true"], :user-invalid:is(form *):not(form[data-validate="submit"]:not([data-submitted]) *)) {
      border-color: var(--destructive);

      &:focus {
        border-color: var(--destructive);
        box-shadow: 0 0 0 2px oklch(from var(--destructive) l c h / 0.2);
      }
    }
  }

  /* -- Textarea group: a composer --------------------------------
     The GROUP draws the frame (border, radius, focus ring, drop target);
     the .textarea inside goes frameless and grows. Children in order: an
     optional .file-drop-list (attachment chips, the file-input's own
     items), the textarea, a .textarea-group-actions row (attach, send,
     a counter). data-layout="inline" puts the actions beside the text -
     a one-line chat composer that grows upward. */
  .textarea-group {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid var(--input);
    border-radius: var(--radius-lg);
    background: var(--background);
    box-shadow: var(--shadow-xs);
    transition:
      border-color 150ms,
      box-shadow 150ms,
      background-color 150ms;

    & > .textarea {
      min-height: calc(2lh + 1rem);
      border: 0;
      border-radius: inherit;
      background: transparent;
      box-shadow: none;
      resize: none;
      padding: 0.75rem 0.875rem 0.25rem;

      &:focus {
        box-shadow: none;
      }
    }

    &:has(> .textarea:focus) {
      border-color: var(--ring);
      box-shadow: 0 0 0 2px oklch(from var(--ring) l c h / 0.2);
    }

    &:has(> .textarea:disabled) {
      background: var(--muted);
      box-shadow: none;
    }

    /* attachment chips above the text - a wrapping row of file items */
    & > .file-drop-list {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      padding: 0.625rem 0.625rem 0;

      &:empty {
        display: none;
      }
      & > .file-drop-item {
        width: 13rem;
        max-width: 100%;
        box-sizing: border-box;
      }
    }

    & > .textarea-group-actions {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.375rem;

      /* everything after the spacer sits at the end - usually send */
      & > .textarea-group-spacer {
        flex: 1;
      }
    }

    & .textarea-group-count {
      padding-inline: 0.375rem;
      color: var(--muted-foreground);
      font-size: 0.75rem;
      font-variant-numeric: tabular-nums;
    }

    /* inline: [actions] text [actions] on one row, aligned to the last line */
    &[data-layout="inline"] {
      flex-flow: row wrap;
      align-items: flex-end;

      & > .file-drop-list {
        flex-basis: 100%;
      }
      & > .textarea {
        flex: 1;
        min-width: 0;
        min-height: calc(1lh + 1rem);
        padding: 0.5rem 0.25rem;
      }
      & > .textarea:first-child {
        padding-inline-start: 0.875rem;
      }
      & > .textarea-group-actions {
        padding: 0.3125rem;
      }
    }

    /* a file dragged over the composer: the page sets data-dragover */
    &[data-dragover] {
      border-style: dashed;
      border-color: var(--ring);
      background: color-mix(in oklch, var(--accent) 45%, var(--background));
    }
  }

  /* -- Accessibility ---------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .textarea,
    .textarea-group {
      transition: none;
    }
  }

  @media (prefers-contrast: more) {
    .textarea,
    .textarea-group {
      border-width: 2px;
    }
    .textarea-group > .textarea {
      border-width: 0;
    }

    .textarea:disabled {
      border-color: var(--muted-foreground);
    }
  }

  @media (forced-colors: active) {
    .textarea-group {
      border-color: ButtonBorder;
    }
    .textarea-group:has(> .textarea:focus) {
      outline: 2px solid Highlight;
      outline-offset: 1px;
    }
    .textarea-group > .textarea:focus {
      outline: none;
    }

    .textarea {
      border-color: ButtonBorder;
      color: ButtonText;
      background: Field;
    }

    .textarea:focus {
      outline: 2px solid Highlight;
      outline-offset: 1px;
    }

    .textarea:disabled {
      opacity: 1;
      background-image: none;
      color: GrayText;
      border-color: GrayText;
    }

    .textarea:is(
      [aria-invalid="true"],
      :user-invalid:is(form *):not(form[data-validate="submit"]:not([data-submitted]) *)
    ) {
      border-color: LinkText;
    }
  }
}

/* ── components/toast/toast.css ── */
/* -- Toast component ------------------------------------------- */

@layer components {
  /* -- Container ------------------------------------------------ */
  .toast-container {
    position: fixed;
    z-index: 100;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    padding: 1rem;
    max-height: 100vh;
    pointer-events: none;

    &[data-position="bottom-right"] {
      bottom: 0;
      right: 0;
    }
    &[data-position="bottom-left"] {
      bottom: 0;
      left: 0;
    }
    &[data-position="top-right"] {
      top: 0;
      right: 0;
      flex-direction: column;
    }
    &[data-position="top-left"] {
      top: 0;
      left: 0;
      flex-direction: column;
    }
    &[data-position="top-center"] {
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      flex-direction: column;
      align-items: center;
    }
    &[data-position="bottom-center"] {
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      align-items: center;
    }
  }

  /* -- Toast ---------------------------------------------------- */
  .toast {
    /* Top layer (popover="manual") bypasses the container's flex layout - the
       UA sheet would CENTER every toast (inset:0 + margin:auto). Pin each toast
       to its container's corner instead and stack via --toast-stack, which the
       component JS measures (toast.ts stackToasts) since heights vary. */
    position: fixed;
    inset: auto;
    margin: 0;
    /* the UA popover sheet clips (overflow: auto) - the pile badge sits on the edge */
    overflow: visible;
    background-color: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    min-width: 20rem;
    max-width: 26rem;
    box-shadow: 0 4px 16px oklch(0 0 0 / 0.12);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(0.5rem);
    transition:
      opacity 200ms ease,
      transform 200ms ease;

    &:popover-open {
      opacity: 1;
      transform: translateY(0);
    }

    /* -- Corner placement (top layer - see note above) ------------
       --toast-stack: measured px offset of the stack below this toast;
       the first toast is 0, so default bottom-right lands at the edge. */
    [data-position="bottom-right"] & {
      bottom: calc(1rem + var(--toast-stack, 0px));
      right: 1rem;
    }
    [data-position="bottom-left"] & {
      bottom: calc(1rem + var(--toast-stack, 0px));
      left: 1rem;
    }
    [data-position="top-right"] & {
      top: calc(1rem + var(--toast-stack, 0px));
      right: 1rem;
    }
    [data-position="top-left"] & {
      top: calc(1rem + var(--toast-stack, 0px));
      left: 1rem;
    }
    [data-position="top-center"] & {
      top: calc(1rem + var(--toast-stack, 0px));
      left: 50%;
      translate: -50% 0;
    }
    [data-position="bottom-center"] & {
      bottom: calc(1rem + var(--toast-stack, 0px));
      left: 50%;
      translate: -50% 0;
    }

    /* -- Sizes + Density ------------------------------------------
       data-size scales the toast's width envelope (sm/md/lg, md == the
       unsized default); data-density is the whitespace policy - padding and
       the content gap at the shared 0.75 / 1 / 1.25 ratio, comfortable ==
       the unsized default. Both live on the .toast element itself. */
    &[data-size="sm"] {
      min-width: 16rem;
      max-width: 20rem;
    }
    &[data-size="md"] {
      min-width: 20rem;
      max-width: 26rem;
    }
    &[data-size="lg"] {
      min-width: 24rem;
      max-width: 32rem;
    }

    &[data-density="compact"] {
      padding: 0.75rem;
      & .toast-content {
        gap: 0.5rem;
      }
    }
    &[data-density="comfortable"] {
      padding: 1rem;
    }
    &[data-density="spacious"] {
      padding: 1.25rem;
      & .toast-content {
        gap: 1rem;
      }
    }

    /* -- Variants ------------------------------------------------- */
    &[data-variant="destructive"] {
      background-color: var(--destructive);
      color: var(--destructive-foreground);
      border-color: var(--destructive);

      & .toast-description {
        color: var(--destructive-foreground);
        opacity: 0.85;
      }
    }

    /* -- Semantic variants (border + icon color) ----------------- */
    &[data-variant="success"] {
      border-color: oklch(0.65 0.2 145);

      & .toast-icon {
        color: oklch(0.65 0.2 145);
      }
    }

    &[data-variant="warning"] {
      border-color: oklch(0.75 0.18 75);

      & .toast-icon {
        color: oklch(0.75 0.18 75);
      }
    }

    &[data-variant="info"] {
      border-color: oklch(0.6 0.15 250);

      & .toast-icon {
        color: oklch(0.6 0.15 250);
      }
    }
  }

  @starting-style {
    .toast:popover-open {
      opacity: 0;
      transform: translateY(0.5rem);
    }
  }

  /* -- Named animations (options.animation) ------------------------
     df$.anim plays the entrance / exit; the CSS fade stands down. */
  .toast[data-anim] {
    transition:
      bottom 220ms ease,
      top 220ms ease,
      scale 220ms ease,
      opacity 220ms ease;

    &:popover-open {
      opacity: 1;
      transform: none;
    }
  }
  @starting-style {
    .toast[data-anim]:popover-open {
      opacity: 1;
      transform: none;
    }
  }

  /* -- Pile (df$.shadcn.toast.configure({ stack: 'pile' })) ----------
     The newest toast is in front and wears the shapes.css stack-* sheets
     (added by toast.js); the older ones wait behind it, hidden, and fan out
     into a list while the pointer or focus is inside the pile. A "+n" badge
     counts the hidden ones. */
  .toast-container[data-stack="pile"] .toast {
    transition:
      opacity 200ms ease,
      transform 200ms ease,
      bottom 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      top 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      scale 220ms ease;
  }
  .toast[data-piled] {
    opacity: 0 !important;
    scale: 0.94;
    pointer-events: none;
  }
  .toast[data-more]:not([data-more="0"])::after {
    content: "+" attr(data-more);
    position: absolute;
    inset-block-start: -0.5rem;
    inset-inline-start: -0.5rem;
    min-width: 1.5rem;
    height: 1.5rem;
    padding-inline: 0.375rem;
    border-radius: 9999px;
    background-color: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
  }
  .toast-container[data-position^="top"] .toast[data-more]::after {
    inset-block-start: auto;
    inset-block-end: -0.5rem;
  }

  /* -- Aura (options.aura) ------------------------------------------
     The toast is the ring of light (shapes.css .aura), its content sits on
     an inner surface with the toast's own colors and padding. */
  .toast[data-aura] {
    --shape-round: var(--radius-lg);
    border: 0;
    background-color: transparent;
    box-shadow: 0 8px 28px -6px color-mix(in oklch, var(--foreground) 30%, transparent);
  }
  .toast-surface {
    padding: 1rem;
    border-radius: var(--radius-lg);
    background-color: var(--popover);
    color: var(--popover-foreground);

    .toast[data-variant="destructive"] > & {
      background-color: var(--destructive);
      color: var(--destructive-foreground);
    }
  }

  /* -- Inner elements ------------------------------------------- */
  .toast-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .toast-text {
    flex: 1;
    min-width: 0;
  }

  .toast-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
  }

  .toast-description {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin: 0.125rem 0 0;
    line-height: 1.5;
  }

  .toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: calc(var(--radius) * 0.5);
    transition:
      color 150ms,
      background 150ms;

    &:hover {
      color: var(--foreground);
      background: var(--accent);
    }
  }

  .toast-icon {
    /* explicit size: SVGs without width/height render at a ~300px intrinsic
       default, which blew up the whole toast */
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
  }

  .toast-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
}

/* Accessibility: suppress motion for users who request it (REQUIRED for all
   components - AGENTS.md "Accessibility CSS"). Near-zero duration instead of
   `none` keeps transitionend/animationend (and discrete display flips)
   firing so JS state machines that await them keep working. */
@media (prefers-reduced-motion: reduce) {
  @layer components {
    .toast-container,
    .toast-container *,
    .toast-container::before,
    .toast-container::after,
    .toast-container *::before,
    .toast-container *::after,
    .toast-container::backdrop,
    .toast,
    .toast *,
    .toast::before,
    .toast::after,
    .toast *::before,
    .toast *::after,
    .toast::backdrop,
    .toast-description,
    .toast-description *,
    .toast-description::before,
    .toast-description::after,
    .toast-description *::before,
    .toast-description *::after,
    .toast-description::backdrop,
    .toast-icon,
    .toast-icon *,
    .toast-icon::before,
    .toast-icon::after,
    .toast-icon *::before,
    .toast-icon *::after,
    .toast-icon::backdrop,
    .toast-content,
    .toast-content *,
    .toast-content::before,
    .toast-content::after,
    .toast-content *::before,
    .toast-content *::after,
    .toast-content::backdrop,
    .toast-text,
    .toast-text *,
    .toast-text::before,
    .toast-text::after,
    .toast-text *::before,
    .toast-text *::after,
    .toast-text::backdrop,
    .toast-title,
    .toast-title *,
    .toast-title::before,
    .toast-title::after,
    .toast-title *::before,
    .toast-title *::after,
    .toast-title::backdrop,
    .toast-close,
    .toast-close *,
    .toast-close::before,
    .toast-close::after,
    .toast-close *::before,
    .toast-close *::after,
    .toast-close::backdrop,
    .toast-actions,
    .toast-actions *,
    .toast-actions::before,
    .toast-actions::after,
    .toast-actions *::before,
    .toast-actions *::after,
    .toast-actions::backdrop {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}

/* ── components/toggle/toggle.css ── */
/* -- Toggle component ------------------------------------------ */

@layer components {
  .toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    line-height: 1;
    white-space: nowrap;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition:
      color 150ms ease,
      background-color 150ms ease,
      box-shadow 150ms ease;
    outline: none;
    flex-shrink: 0;
    height: 2.25rem;
    padding: 0 0.5rem;
    min-width: 2.25rem;

    &:hover:not(:disabled) {
      background-color: var(--muted);
      color: var(--muted-foreground);
    }

    &[aria-pressed="true"] {
      background-color: var(--accent);
      color: var(--accent-foreground);

      &:hover:not(:disabled) {
        background-color: color-mix(in oklch, var(--accent) 85%, var(--foreground));
      }
    }

    &:focus-visible {
      outline: 2px solid var(--ring);
      outline-offset: 2px;
    }

    /* disabled: dimmed, with the not-allowed cursor - no pointer-events: none,
       which would hide the cursor too (a disabled button fires no click) */
    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    & svg {
      pointer-events: none;
      flex-shrink: 0;

      &:not([class*="size-"]) {
        width: 1rem;
        height: 1rem;
      }
    }

    /* -- Variants -------------------------------------------- */
    &[data-variant="outline"] {
      border: 1px solid var(--input);
      background: transparent;
      box-shadow: var(--shadow-xs);

      &:hover:not(:disabled) {
        background-color: var(--accent);
        color: var(--accent-foreground);
      }

      &[aria-pressed="true"] {
        background-color: var(--accent);
        color: var(--accent-foreground);

        &:hover:not(:disabled) {
          background-color: color-mix(in oklch, var(--accent) 85%, var(--foreground));
        }
      }
    }

    /* -- Sizes ----------------------------------------------- */
    &[data-size="xs"] {
      height: 1.75rem;
      padding: 0 0.25rem;
      min-width: 1.75rem;
      font-size: 0.75rem;
    }
    &[data-size="sm"] {
      height: 2rem;
      padding: 0 0.375rem;
      min-width: 2rem;
    }
    &[data-size="md"] {
      height: 2.25rem;
      padding: 0 0.5rem;
      min-width: 2.25rem;
    }
    &[data-size="lg"] {
      height: 2.5rem;
      padding: 0 0.625rem;
      min-width: 2.5rem;
    }
    &[data-size="xl"] {
      height: 3rem;
      padding: 0 0.75rem;
      min-width: 3rem;
      font-size: 1rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .toggle {
      transition: none;
    }
  }

  @media (prefers-contrast: more) {
    .toggle {
      border: 2px solid transparent;

      &[data-variant="outline"] {
        border-color: var(--foreground);
      }

      &[aria-pressed="true"] {
        border-color: currentColor;
      }
    }
  }

  @media (forced-colors: active) {
    .toggle {
      border: 1px solid ButtonText;

      &[aria-pressed="true"] {
        background: Highlight;
        color: HighlightText;
      }

      &:disabled {
        border-color: GrayText;
        color: GrayText;
      }
    }
  }
}

/* ── components/typography/typography.css ── */
/* -- Typography component --------------------------------------- */

/* -- Base text ---------------------------------------------- */
/* Sets the default font size for the entire page.            */
/* All typography classes are sized relative to this baseline. */
@layer base {
  body {
    font-size: 0.875rem;
    line-height: 1.5;
  }
  /* code reads in the theme's monospace stack, not the browser's default (a
     Courier on macOS) - zero specificity, so a component's own face wins */
  :where(code, kbd, samp, pre) {
    font-family: var(--font-mono);
  }
}

@layer components {
  /* -- Headings ---------------------------------------------- */
  .h1 {
    scroll-margin-top: 5rem;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-wrap: balance;
    color: var(--foreground);
  }

  .h2 {
    scroll-margin-top: 5rem;
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-wrap: balance;
    color: var(--foreground);
    border-block-end: 1px solid var(--border);
    padding-block-end: 0.5rem;

    &:first-child {
      margin-block-start: 0;
    }
  }

  .h3 {
    scroll-margin-top: 5rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-wrap: balance;
    color: var(--foreground);
  }

  .h4 {
    scroll-margin-top: 5rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    text-wrap: balance;
    color: var(--foreground);
  }

  /* -- Paragraph --------------------------------------------- */
  .p {
    font-size: 0.875rem;
    line-height: 1.75;
    text-wrap: pretty;
    color: var(--foreground);

    &:not(:first-child) {
      margin-block-start: 1.5rem;
    }
  }

  /* -- Lead --------------------------------------------------- */
  .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--muted-foreground);
    text-wrap: pretty;
  }

  /* -- Large -------------------------------------------------- */
  .large {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
  }

  /* -- Small -------------------------------------------------- */
  .small {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    color: var(--foreground);
  }

  /* -- Muted -------------------------------------------------- */
  .muted {
    font-size: 0.875rem;
    color: var(--muted-foreground);
  }

  /* -- Link ------------------------------------------------- */
  /* a link in running text: the primary colour, the line and its offset from
     the theme's link tokens (literal fallbacks for a theme without them) */
  .link {
    color: var(--primary);
    text-decoration: var(--link-text-decoration, underline);
    text-underline-offset: var(--link-underline-offset, 4px);
  }

  /* -- Blockquote --------------------------------------------- */
  .blockquote {
    margin-block-start: 1.5rem;
    border-inline-start: 2px solid var(--border);
    padding-inline-start: 1.5rem;
    font-style: italic;
    hanging-punctuation: first last;
    color: var(--foreground);

    & p {
      margin: 0;
    }
  }

  /* -- Inline code -------------------------------------------- */
  .inline-code {
    position: relative;
    border-radius: var(--radius-sm);
    background: var(--muted);
    padding: 0.2rem 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.875em;
    font-weight: 600;
    color: var(--foreground);
  }

  /* -- CJK: Chinese, Japanese, Korean ------------------------------
     Keyed on the lang attribute, so one set of classes serves every script.
     Latin tuning is undone (negative tracking, faux italics); paragraphs
     justify between characters with strict line breaking (kinsoku: no 。
     or ， at a line start), and sentence-end punctuation may hang past the
     edge (Safari: hanging-punctuation) or trims to half width
     (Chromium: text-spacing-trim) so the justified edge stays straight.
     text-autospace adds the thin gap between CJK and Latin /
     digits that authors used to type by hand. */
  :is(.h1, .h2, .h3, .h4, .lead, .large):is(:lang(zh), :lang(ja), :lang(ko)),
  :is(:lang(zh), :lang(ja), :lang(ko)) :is(.h1, .h2, .h3, .h4, .lead, .large) {
    letter-spacing: 0;
  }
  /* Japanese headings break between phrases (bunsetsu), not mid-word */
  :is(.h1, .h2, .h3, .h4, .lead):lang(ja),
  :lang(ja) :is(.h1, .h2, .h3, .h4, .lead) {
    word-break: auto-phrase;
  }
  :is(.p, .lead, .blockquote):is(:lang(zh), :lang(ja), :lang(ko)),
  :is(:lang(zh), :lang(ja), :lang(ko)) :is(.p, .lead, .blockquote) {
    line-height: 1.9;
    line-break: strict;
    text-autospace: normal;
  }
  :is(.p, .blockquote):is(:lang(zh), :lang(ja)),
  :is(:lang(zh), :lang(ja)) :is(.p, .blockquote) {
    text-align: justify;
    text-justify: inter-character;
    /* the line-end 。，: Safari hangs it past the edge; Chromium trims the
       fullwidth glyph's blank half (text-spacing-trim) - either way the
       justified edge stays straight */
    hanging-punctuation: allow-end;
    text-spacing-trim: normal;
  }
  /* CJK has no italics - a slanted Han character is a synthetic oblique */
  .blockquote:is(:lang(zh), :lang(ja), :lang(ko)),
  :is(:lang(zh), :lang(ja), :lang(ko)) .blockquote {
    font-style: normal;
  }

  /* -- Vertical text (tategaki / 直排) ----------------------------------
     .text-vertical sets top-to-bottom lines flowing right to left. Latin
     runs lie sideways (text-orientation: mixed); .text-upright stands a
     short run (a two-digit number) upright in one cell - tate-chu-yoko.
     The spacing above uses logical properties, so headings, paragraphs and
     the blockquote rule turn with the text. Give the block a height. */
  .text-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }
  .text-upright {
    text-combine-upright: all;
  }

  /* -- Emphasis marks (圈点 / 傍点) ---------------------------------------
     Dots beside each character instead of italics: over the text in
     Japanese (right of it when vertical), under it in Chinese. */
  .text-emphasis {
    font-style: normal;
    text-emphasis: filled dot;
    text-emphasis-position: over right;
  }
  .text-emphasis:lang(ja) {
    text-emphasis-style: filled sesame;
  }
  .text-emphasis:lang(zh) {
    text-emphasis-position: under right;
  }

  /* ruby annotations (furigana, pinyin, zhuyin) read as small, muted type */
  :is(.p, .lead, .blockquote, .h1, .h2, .h3, .h4) rt {
    font-size: 0.5em;
    color: var(--muted-foreground);
    letter-spacing: 0;
  }

  /* -- Typesetting (Satz): book and journal setting ----------------------
     .typeset holds continuous text set like a book or a journal page. Each
     classic rule is an opt-in data attribute, tuned by a --typeset-* knob -
     component properties, not theme tokens (the theme set stays the
     tweakcn shape):
       data-columns="2|3"        columns never narrower than
                                 --typeset-column-width: a phone gets one
       data-rule                 a hairline between the columns
       data-align="justify"      Blocksatz: justified and hyphenated (set
                                 lang=""), the last line flush start
       data-indent               Einzug: paragraphs follow without a gap and
                                 indent their first line; the first one after
                                 a heading starts flush (stumpf)
       data-initial="drop|raised"  Initiale over --typeset-initial-lines lines
       data-lead="smallcaps|caps"  the opening line in small capitals or in
                                 letterspaced capitals (Versalien)
       data-ligatures="classic"  discretionary and historical ligatures,
                                 old-style figures - where the font has them
       data-leading="tight|loose"  compact or airy lines, the tracking matched
       data-orphans / data-widows="3|4"  lines kept together at a break (2)
     .typeset-span spans every column (a heading, a figure). Figures, tables,
     quotes, groups and Separator breaks keep --typeset-gap from the text -
     the Separator component draws the break, this block only spaces it.
     VERIFIED: (typography.e2e, the typeset checks) every rule as a computed
     style, the gaps, the captions' counters, 44rem two columns vs 20rem one. */
  .typeset {
    --typeset-measure: 68ch;
    --typeset-column-width: 18rem;
    --typeset-column-gap: 2.5em;
    --typeset-indent: 1em;
    --typeset-leading: 1.65;
    --typeset-tracking: 0em;
    --typeset-gap: 1.5em;
    --typeset-initial-lines: 3;
    --typeset-initial-gap: 0.3em;
    --typeset-initial-font: var(--font-serif);
    --typeset-initial-color: var(--primary);

    max-inline-size: var(--typeset-measure);
    line-height: var(--typeset-leading);
    letter-spacing: var(--typeset-tracking);
    text-wrap: pretty;
    hanging-punctuation: first allow-end last;
    font-kerning: normal;
    orphans: 2;
    widows: 2;

    /* a .typeset-keep is a wrapper, not a block: what it holds is spaced as
       if it sat in the setting itself (each rule names both paths - :is()
       would raise the direct path's specificity to the wrapper path's) */
    & > p,
    & > .typeset-keep > p {
      margin-block: 0 1em;
    }
    /* every block keeps the same distance from the text around it */
    &
      > :is(
        figure,
        table,
        blockquote,
        pre,
        hr,
        .separator,
        .typeset-group,
        .chart,
        .diagram,
        .mockup-code,
        .table-container
      ),
    &
      > .typeset-keep
      > :is(
        figure,
        table,
        blockquote,
        pre,
        hr,
        .separator,
        .typeset-group,
        .chart,
        .diagram,
        .mockup-code,
        .table-container
      ) {
      margin-block: var(--typeset-gap);
    }
    /* a figure spans the measure (the browser indents it 40px by default) */
    & > :is(figure, blockquote),
    & > .typeset-keep > :is(figure, blockquote) {
      margin-inline: 0;
    }
    & > :is(h1, h2, h3, h4, .h1, .h2, .h3, .h4),
    & > .typeset-keep > :is(h1, h2, h3, h4, .h1, .h2, .h3, .h4) {
      margin-block: var(--typeset-gap) 0.5em;
    }
    & > :first-child,
    & > .typeset-keep:first-child > :first-child {
      margin-block-start: 0;
    }
    & :is(figure, blockquote, table, pre, .typeset-group) {
      break-inside: avoid;
    }
    /* a long table or listing may split: kept whole, it would leave the rest
       of a page empty, and one taller than a page splits anyway. Every piece
       keeps the frame (clone): sliced, the first piece lost its bottom border
       and corners at the column foot, the next its top. A figure that may
       split lets the listing inside it split too, and its caption stays with
       the last piece.
       VERIFIED: (Chromium PDF probe 2026-10-12) a framed listing split over
       two columns and over two pages prints a closed, rounded frame on each. */
    & [data-break-inside="allow"],
    & [data-break-inside="allow"] :is(figure, blockquote, table, pre, .typeset-group, .mockup-code) {
      break-inside: auto;
      box-decoration-break: clone;
    }
    /* ... and a listing that may split does not scroll sideways: Chromium
       never breaks a scroll container, so the listing moved whole and left its
       caption behind - wrap its lines instead (pre-wrap, a Code Mockup's
       data-wrap). VERIFIED: (Chromium probe 2026-10-12) overflow-x: auto kept
       the paper's closing report whole at 900px, overflow-x: visible split it. */
    & :is(pre, .mockup-code):is([data-break-inside="allow"], [data-break-inside="allow"] *) {
      overflow-x: visible;
    }
    /* a caption never breaks alone to the next column or page - on screen,
       where the columns balance, as in print. A figure that may split is a
       block, its caption kept to the last piece (below) or the first (above).
       VERIFIED: (Chromium, screen and PDF 2026-10-12) in a grid figure the
       keep did nothing and the caption stood alone at the head of the next
       column; in block flow the break moved up into the listing and two lines
       went along with the caption. A figure group keeps its grid. */
    & figure[data-break-inside="allow"]:not(.typeset-group) {
      display: block;

      & > figcaption:last-child {
        break-before: avoid;
      }
      & > figcaption:first-child {
        break-after: avoid;
      }
    }
    & :is(h1, h2, h3, h4, .h1, .h2, .h3, .h4) {
      break-after: avoid;
    }
    /* the lines a paragraph keeps together at a column or page break: at the
       foot of the column (orphans) and at the head of the next (widows) */
    &[data-orphans="3"] {
      orphans: 3;
    }
    &[data-orphans="4"] {
      orphans: 4;
    }
    &[data-widows="3"] {
      widows: 3;
    }
    &[data-widows="4"] {
      widows: 4;
    }
    & .typeset-span {
      column-span: all;
    }
    /* the columns below a spanning heading or figure start level: the first
       block keeps no top margin - across the column break it cannot collapse
       into the spanner's, so a subheading sat lower than the text beside it */
    &[data-columns] > .typeset-span + :not(.typeset-span),
    &[data-columns] > .typeset-span + .typeset-keep > :first-child {
      margin-block-start: 0;
    }

    &[data-columns] {
      max-inline-size: none;
      column-gap: var(--typeset-column-gap);
    }
    &[data-columns="2"] {
      columns: 2 var(--typeset-column-width);
    }
    &[data-columns="3"] {
      columns: 3 var(--typeset-column-width);
    }
    &[data-rule] {
      column-rule: 1px solid var(--border);
    }

    &[data-align="justify"] {
      text-align: justify;
      text-align-last: start;
      hyphens: auto;
      hyphenate-limit-chars: 6 3 2;

      /* text-align-last inherits: a centered caption inside a justified setting
         kept its last line flush left (a two-line figure caption looked
         off-center) - what centers itself takes its last line from its own alignment */
      & :where(figcaption, caption, .typeset-caption) {
        text-align-last: auto;
      }
    }

    /* leading and tracking move together: tight lines close up a little,
       airy lines open up a little, so the grey of the column stays even */
    &[data-leading="tight"] {
      --typeset-leading: 1.45;
      --typeset-tracking: -0.01em;
    }
    &[data-leading="loose"] {
      --typeset-leading: 1.9;
      --typeset-tracking: 0.01em;
    }

    &[data-indent] > p,
    &[data-indent] > .typeset-keep > p {
      margin-block: 0;
    }
    &[data-indent] > p + p,
    &[data-indent] > .typeset-keep > p + p,
    &[data-indent] > p + .typeset-keep > p:first-child,
    &[data-indent] > p + .typeset-break + p {
      text-indent: var(--typeset-indent);
    }
    /* text-indent inherits into an inline-block, which then indents ITS first line: a badge,
       a key cap or an epistemic tag at the start of an indented paragraph grew a blank
       inside its left edge */
    &[data-indent] > p :where(.badge, kbd, .paper-tag),
    &[data-indent] > .typeset-keep > p :where(.badge, kbd, .paper-tag) {
      text-indent: 0;
    }

    /* the gap is a margin: Chromium ignores logical padding on ::first-letter
       (VERIFIED: probe 2026-10-07 - padding-inline-end computed 0, margin-inline-end 2.52px) */
    &[data-initial] > p:first-of-type::first-letter {
      margin-inline-end: var(--typeset-initial-gap);
      font-family: var(--typeset-initial-font);
      font-weight: 600;
      color: var(--typeset-initial-color);
    }
    &[data-initial="drop"] > p:first-of-type::first-letter {
      -webkit-initial-letter: var(--typeset-initial-lines);
      initial-letter: var(--typeset-initial-lines);
    }
    &[data-initial="raised"] > p:first-of-type::first-letter {
      -webkit-initial-letter: var(--typeset-initial-lines) 1;
      initial-letter: var(--typeset-initial-lines) 1;
    }

    &[data-lead="smallcaps"] > p:first-of-type::first-line {
      font-variant-caps: all-small-caps;
      letter-spacing: 0.04em;
    }
    /* letterspaced capitals - and the small-caps lead beside an initial:
       a first line in small capitals moves the initial down a line
       (Chromium), capitals keep its top level with the line's */
    &:is([data-lead="caps"], [data-initial][data-lead="smallcaps"]) > p:first-of-type::first-line {
      font-variant-caps: normal;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    &[data-ligatures="classic"] {
      font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures contextual;
      font-variant-numeric: oldstyle-nums proportional-nums;
    }
  }
  /* a heading is never justified: a wrapping heading stretched to the measure
     opened wide gaps between its words. Flush start and unhyphenated - zero
     specificity, so an alignment the heading sets itself still wins */
  :where(.typeset[data-align="justify"]) :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4) {
    text-align: start;
    text-align-last: auto;
    hyphens: manual;
  }
  /* a verbatim record keeps its spacing: justified, a wrapped line of program
     output opened wide gaps between its words, and hyphenation split its
     identifiers (pa-per.mdx) - a pre is set flush start, unhyphenated */
  :where(.typeset[data-align="justify"]) :where(pre) {
    text-align: start;
    text-align-last: auto;
    hyphens: manual;
  }
  /* no initial-letter (Firefox): a floated letter as tall as the lines */
  @supports not ((initial-letter: 3) or (-webkit-initial-letter: 3)) {
    .typeset[data-initial] > p:first-of-type::first-letter {
      float: inline-start;
      font-size: calc(var(--typeset-initial-lines) * var(--typeset-leading) * 1em * 0.82);
      line-height: 0.8;
      padding-block-start: 0.08em;
    }
  }

  /* -- Captions (Bildunterschriften), numbered in order ------------------
     .typeset-caption on a figcaption (a picture, a video, a chart) or a
     table's caption. Inside .typeset-numbered, figures and tables count on
     their own: "Figure 1.", "Table 1." - the words are --typeset-figure-label
     and --typeset-table-label ("" leaves the bare number: "1."). A caption
     is flush start; data-align="justify" or "center" sets it otherwise. */
  .typeset-numbered {
    --typeset-figure-label: "Figure ";
    --typeset-table-label: "Table ";

    counter-reset: typeset-figure typeset-table;
  }
  .typeset-caption {
    margin-block-start: 0.6em;
    color: var(--muted-foreground);
    font-size: 0.875em;
    line-height: 1.5;
    text-align: start;
    text-align-last: auto;
    text-wrap: pretty;
    caption-side: top;

    &[data-align="justify"] {
      text-align: justify;
      text-align-last: start;
      hyphens: auto;
    }
    &[data-align="center"] {
      text-align: center;
      text-wrap: balance;
    }
    table > & {
      margin-block: 0 0.6em;
    }
  }
  .typeset-numbered :is(figcaption.typeset-caption)::before {
    counter-increment: typeset-figure;
    content: var(--typeset-figure-label) counter(typeset-figure) ". ";
    color: var(--foreground);
    font-weight: 600;
  }
  .typeset-numbered
    :is(
      caption.typeset-caption,
      figure:has(> table) > figcaption.typeset-caption,
      figure:has(> .table-container) > figcaption.typeset-caption
    )::before {
    counter-increment: typeset-table;
    content: var(--typeset-table-label) counter(typeset-table) ". ";
  }

  /* -- Figure groups: several figures in one box ---------------------------
     .typeset-group sets two or three figures (charts, pictures, tables) side
     by side; each figure's caption is lettered "(a)", "(b)" (.typeset-subcaption),
     the group's own figcaption numbers the whole. Every figure spans two
     subgrid rows - media, then caption - so the captions of a row sit at one
     height whatever the media's height. data-align="middle" centres the media
     in their row; data-divided draws hairlines between the figures - the
     1px grid gap over a border-coloured background, so the lines run between
     columns and, once the figures stack, between rows, with no container
     query (a size container would scope the caption counters to the group);
     data-variant="cards" gives each figure its own card instead of one box.
     Narrow pages stack them.
     VERIFIED: (typography.e2e "figure groups") captions level, the 1px lines
     between columns and between stacked rows, the cards' borders. */
  .typeset-group {
    --typeset-group-min: 12rem;
    --typeset-group-gap: 1.25rem;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--typeset-group-min)), 1fr));
    gap: var(--typeset-group-gap);
    margin-inline: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    counter-reset: typeset-sub;

    & > figure {
      display: grid;
      grid-row: span 2;
      grid-template-rows: subgrid;
      row-gap: 0.4em;
      align-content: start;
      margin: 0;
      min-inline-size: 0;
    }
    & > figcaption {
      grid-column: 1 / -1;
      margin-block-start: 0.25em;
    }
    & img,
    & video {
      display: block;
      inline-size: 100%;
      block-size: auto;
      border-radius: var(--radius-md);
    }

    &[data-align="middle"] > figure > :first-child {
      align-self: center;
    }

    &[data-variant="cards"] {
      padding: 0;
      border: 0;
      background: none;

      & > figure {
        padding: 0.875rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        background: var(--card);
      }
    }

    &[data-divided] {
      gap: 1px;
      padding: 0;
      overflow: hidden;
      background: var(--border);

      & > figure {
        padding: 1rem;
        background: var(--card);
      }
      & > figcaption {
        margin: 0;
        padding: 0.75rem 1rem 1rem;
        background: var(--card);
      }
    }
  }
  .typeset-subcaption {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.8125em;
    line-height: 1.45;

    &::before {
      counter-increment: typeset-sub;
      content: "(" counter(typeset-sub, lower-alpha) ") ";
      color: var(--foreground);
      font-weight: 600;
    }
  }

  /* -- Breaks and keeps (Umbruch): where a printed page or column ends -----
     .typeset-break is an empty marker that forces a break before the next
     block: data-break="page" (the default), "column" (inside data-columns),
     "left" / "right" (the next page is a left / right page - duplex). It
     breaks in print only: a screen has no pages, and a column break in a
     balanced screen column would push the rest of the text into the last
     column. In print it is a zero-height box carrying break-before -
     display: none would remove the box and the break with it. On screen it
     is hidden; [data-show-breaks] on an ancestor shows every marker as a
     labelled dashed line, an authoring aid.
     .typeset-keep keeps its content in one column and on one page (avoid
     covers both - avoid-page would still let a column break split it).
     VERIFIED: (typography.e2e "breaks and keeps", paper.e2e "print") the
     computed breaks in print media; a printed PDF with a page and a column
     break; a zero-height break in the paper's grid leaves no gap at the top
     of the new page. */
  .typeset-break {
    display: none;
  }
  @media screen {
    [data-show-breaks] .typeset-break {
      display: flex;
      align-items: center;
      gap: 0.75em;
      margin-block: 1em;
      color: var(--muted-foreground);
      font: 500 0.6875rem/1 var(--font-mono);
      letter-spacing: 0.06em;
      text-transform: uppercase;

      &::before {
        content: "Page break";
      }
      &[data-break="column"]::before {
        content: "Column break";
      }
      &[data-break="left"]::before {
        content: "Page break - left page";
      }
      &[data-break="right"]::before {
        content: "Page break - right page";
      }
      &::after {
        content: "";
        flex: 1;
        border-block-start: 1px dashed currentColor;
      }
    }
  }
  @media print {
    .typeset-break {
      display: block;
      block-size: 0;
      margin: 0;
      padding: 0;
      border: 0;
      visibility: hidden;
      break-before: page;

      &[data-break="column"] {
        break-before: column;
      }
      &[data-break="left"] {
        break-before: left;
      }
      &[data-break="right"] {
        break-before: right;
      }
    }
    /* a printed column rule runs straight through a spanning heading or
       figure that starts a page - so a setting with spanners prints without it.
       VERIFIED: (Chromium PDF probe 2026-10-12) a column-span: all block that a
       natural page break puts at the top of a page is crossed by the rule; an
       opaque background hides it only while background graphics print. */
    .typeset[data-rule]:has(> .typeset-span) {
      column-rule-style: none;
    }
  }
  .typeset-keep {
    break-inside: avoid;
  }

  /* -- Accessibility ------------------------------------------ */

  @media (prefers-contrast: more) {
    .h1,
    .h2,
    .h3,
    .h4 {
      letter-spacing: 0;
    }

    .typeset {
      --typeset-initial-color: var(--foreground);
    }

    .blockquote {
      border-inline-start-width: 3px;
    }

    .inline-code {
      outline: 1px solid var(--border);
    }

    .muted,
    [data-show-breaks] .typeset-break {
      color: var(--foreground);
    }

    /* a theme may drop the underline; more contrast brings it back */
    .link {
      text-decoration-line: underline;
    }
  }

  @media (forced-colors: active) {
    .blockquote {
      border-inline-start-color: CanvasText;
    }

    .typeset {
      --typeset-initial-color: CanvasText;
    }

    .typeset[data-rule] {
      column-rule-color: CanvasText;
    }

    .inline-code {
      background: Canvas;
      outline: 1px solid CanvasText;
      color: CanvasText;
    }

    .link {
      color: LinkText;
      text-decoration-line: underline;
    }
  }
}

/* ── components/video/video.css ── */
/* -- Video component ------------------------------------------ */
/* A native <video> in a frame of its ratio, a captions overlay   */
/* the runtime fills from the active cue, and a control bar of    */
/* Buttons, Sliders and readouts (data-video-action / -output).   */
/* data-variant="overlay" lays the bar over the picture; it hides */
/* while the video plays and nothing points at it.                */
@layer components {
  .video {
    --video-ratio: 16 / 9;

    position: relative;
    display: grid;
    margin: 0;
    inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background-color: var(--card);
    color: var(--card-foreground);
    container-type: inline-size;
  }

  .video-frame {
    position: relative;
    aspect-ratio: var(--video-ratio);
    background-color: #000;

    & > video {
      display: block;
      inline-size: 100%;
      block-size: 100%;
      object-fit: contain;
    }
  }

  /* the active cue - empty when captions are off or nothing is said */
  .video-captions {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0.75rem;
    inline-size: fit-content;
    max-inline-size: 90%;
    margin-inline: auto;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    background-color: rgb(0 0 0 / 0.75);
    color: #fff;
    font-size: clamp(0.8125rem, 3.4cqi, 1.375rem);
    line-height: 1.35;
    text-align: center;
    white-space: pre-line;
    text-wrap: balance;
    pointer-events: none;

    &:empty {
      display: none;
    }
  }

  .video-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-inline-size: 0;
    padding: 0.375rem 0.5rem;
    border-block-start: 1px solid var(--border);

    & > [data-video-action="seek"] {
      flex: 1;
      min-inline-size: 3rem;
    }

    & > [data-video-action="volume"] {
      inline-size: 4.5rem;
    }
  }

  /* a readout: m:ss in even digits, so the bar does not jitter */
  .video-time {
    min-inline-size: 2.5rem;
    color: var(--muted-foreground);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  /* a toggle with two icons shows the first when off, the second when on (play / pause, sound / muted) */
  [data-video-action][aria-pressed="false"] > :nth-child(2),
  [data-video-action][aria-pressed="true"] > :nth-child(1):not(:only-child) {
    display: none;
  }

  /* a control the page may not use (full screen in a frame without it) - over the Button's own display */
  [data-video-action][hidden] {
    display: none;
  }

  /* a rate select keeps its own width in the row (a Select is as wide as its box) */
  select[data-video-action="rate"] {
    flex: none;
    inline-size: auto;
  }

  /* the sound button with a vertical volume in a panel above it (below with data-side="bottom"), shown while the
     pointer or the focus is on either - the row keeps one button's width */
  .video-volume {
    position: relative;
    display: inline-flex;
  }

  .video-volume-panel {
    position: absolute;
    inset-block-end: 100%;
    inset-inline-start: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    margin-block-end: 0.375rem;
    padding: 0.75rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--popover);
    box-shadow: var(--shadow-md);
    translate: -50% 0;
    visibility: hidden;
    opacity: 0;

    /* the gap to the button belongs to the hover */
    &::after {
      position: absolute;
      inset-inline: 0;
      inset-block-start: 100%;
      block-size: 0.5rem;
      content: "";
    }

    /* a vertical range's block axis is horizontal: its length is its height */
    & > .slider[data-orientation="vertical"] {
      height: 5.5rem;
    }

    .video-volume:is(:hover, :focus-within) > & {
      visibility: visible;
      opacity: 1;
    }

    .video-volume[data-side="bottom"] > & {
      inset-block: 100% auto;
      margin-block: 0.375rem 0;

      &::after {
        inset-block: auto 100%;
      }
    }
  }

  /* the bar over the picture: a dark scrim, light controls */
  .video[data-variant="overlay"] {
    & > .video-controls {
      --foreground: #fff;
      --muted-foreground: rgb(255 255 255 / 0.8);
      --accent: rgb(255 255 255 / 0.16);
      --accent-foreground: #fff;
      --primary: #fff;
      --primary-foreground: #000;
      --input: rgb(255 255 255 / 0.35);

      position: absolute;
      inset-inline: 0;
      inset-block-end: 0;
      padding-block-start: 1.5rem;
      border-block-start: 0;
      background-image: linear-gradient(to bottom, transparent, rgb(0 0 0 / 0.72));
      color: #fff;
    }

    & .video-volume-panel {
      border-color: rgb(255 255 255 / 0.2);
      background-color: rgb(0 0 0 / 0.78);
    }

    /* the captions sit above the bar while it shows */
    &:is(:hover, :focus-within, :not([data-state-name="playing"])) .video-captions {
      inset-block-end: 3.25rem;
    }

    &[data-state-name="playing"]:not(:hover, :focus-within) > .video-controls {
      opacity: 0;
    }
  }

  /* full screen: the picture takes what the bar leaves */
  .video:fullscreen {
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background-color: #000;

    & > .video-frame {
      flex: 1;
      aspect-ratio: auto;
    }
  }

  /* a narrow player keeps play, the scrubber, the time and the sound */
  @container (inline-size < 26rem) {
    .video-controls > [data-video-action="volume"],
    .video-controls > [data-video-output="duration"],
    .video-controls > [data-video-action="skip"] {
      display: none;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .video[data-variant="overlay"] {
      & > .video-controls {
        transition: opacity 0.2s ease;
      }

      & .video-captions {
        transition: inset-block-end 0.2s ease;
      }
    }

    .video-volume-panel {
      transition:
        opacity 0.15s ease,
        visibility 0.15s allow-discrete;
    }
  }

  @media (prefers-contrast: more) {
    .video-captions {
      background-color: #000;
    }

    .video-time {
      color: var(--foreground);
    }
  }

  @media (forced-colors: active) {
    .video {
      border-color: CanvasText;
    }

    .video-captions {
      border: 1px solid CanvasText;
      background-color: Canvas;
      color: CanvasText;
      forced-color-adjust: none;
    }

    .video[data-variant="overlay"] > .video-controls {
      background: Canvas;
      opacity: 1;
    }

    .video-volume-panel {
      border-color: CanvasText;
      background-color: Canvas;
    }
  }
}
