/*! AdminVora 1.0.1 — stylesheet (tokens + components)
 * https://github.com/creativeigniter/adminvora
 * Generated by tools/build-dist.mjs. Do not edit.
 */
/*!
 * AdminVora — design tokens (generated)
 * Source of truth: docs/03-design-system + docs/04-theming. Do not edit by hand;
 * regenerate with the token build. Curve: L/C table from 03-color-system.md.
 */
@layer tokens {

/* ── Tier 1 · Primitives ─────────────────────────────────────────────── */
:root {
  /* blue (258) */
  --av-blue-50: oklch(97% 0.014 258);
  --av-blue-100: oklch(94% 0.030 258);
  --av-blue-200: oklch(89% 0.058 258);
  --av-blue-300: oklch(82% 0.094 258);
  --av-blue-400: oklch(72% 0.140 258);
  --av-blue-500: oklch(63% 0.176 258);
  --av-blue-600: oklch(55% 0.190 258);
  --av-blue-700: oklch(47% 0.172 258);
  --av-blue-800: oklch(40% 0.140 258);
  --av-blue-900: oklch(33% 0.106 258);
  --av-blue-950: oklch(24% 0.074 258);
  /* indigo (275) */
  --av-indigo-50: oklch(97% 0.015 275);
  --av-indigo-100: oklch(94% 0.03 275);
  --av-indigo-200: oklch(89% 0.057 275);
  --av-indigo-300: oklch(82% 0.095 275);
  --av-indigo-400: oklch(72% 0.141 275);
  --av-indigo-500: oklch(63% 0.177 275);
  --av-indigo-600: oklch(50% 0.19 275);
  --av-indigo-700: oklch(47% 0.173 275);
  --av-indigo-800: oklch(40% 0.141 275);
  --av-indigo-900: oklch(33% 0.106 275);
  --av-indigo-950: oklch(24% 0.074 275);
  /* violet (295) */
  --av-violet-50: oklch(97% 0.015 295);
  --av-violet-100: oklch(94% 0.03 295);
  --av-violet-200: oklch(89% 0.057 295);
  --av-violet-300: oklch(82% 0.095 295);
  --av-violet-400: oklch(72% 0.141 295);
  --av-violet-500: oklch(63% 0.177 295);
  --av-violet-600: oklch(50% 0.19 295);
  --av-violet-700: oklch(47% 0.173 295);
  --av-violet-800: oklch(40% 0.141 295);
  --av-violet-900: oklch(33% 0.106 295);
  --av-violet-950: oklch(24% 0.074 295);
  /* purple (310) */
  --av-purple-50: oklch(97% 0.015 310);
  --av-purple-100: oklch(94% 0.03 310);
  --av-purple-200: oklch(89% 0.057 310);
  --av-purple-300: oklch(82% 0.095 310);
  --av-purple-400: oklch(72% 0.141 310);
  --av-purple-500: oklch(63% 0.177 310);
  --av-purple-600: oklch(50% 0.19 310);
  --av-purple-700: oklch(47% 0.173 310);
  --av-purple-800: oklch(40% 0.141 310);
  --av-purple-900: oklch(33% 0.106 310);
  --av-purple-950: oklch(24% 0.074 310);
  /* fuchsia (330) */
  --av-fuchsia-50: oklch(97% 0.015 330);
  --av-fuchsia-100: oklch(94% 0.03 330);
  --av-fuchsia-200: oklch(89% 0.057 330);
  --av-fuchsia-300: oklch(82% 0.095 330);
  --av-fuchsia-400: oklch(72% 0.141 330);
  --av-fuchsia-500: oklch(63% 0.177 330);
  --av-fuchsia-600: oklch(50% 0.19 330);
  --av-fuchsia-700: oklch(47% 0.173 330);
  --av-fuchsia-800: oklch(40% 0.141 330);
  --av-fuchsia-900: oklch(33% 0.106 330);
  --av-fuchsia-950: oklch(24% 0.074 330);
  /* pink (350) */
  --av-pink-50: oklch(97% 0.015 350);
  --av-pink-100: oklch(94% 0.03 350);
  --av-pink-200: oklch(89% 0.057 350);
  --av-pink-300: oklch(82% 0.095 350);
  --av-pink-400: oklch(72% 0.141 350);
  --av-pink-500: oklch(63% 0.177 350);
  --av-pink-600: oklch(50% 0.19 350);
  --av-pink-700: oklch(47% 0.173 350);
  --av-pink-800: oklch(40% 0.141 350);
  --av-pink-900: oklch(33% 0.106 350);
  --av-pink-950: oklch(24% 0.074 350);
  /* rose (15) */
  --av-rose-50: oklch(97% 0.015 15);
  --av-rose-100: oklch(94% 0.03 15);
  --av-rose-200: oklch(89% 0.057 15);
  --av-rose-300: oklch(82% 0.095 15);
  --av-rose-400: oklch(72% 0.141 15);
  --av-rose-500: oklch(63% 0.177 15);
  --av-rose-600: oklch(50% 0.19 15);
  --av-rose-700: oklch(47% 0.173 15);
  --av-rose-800: oklch(40% 0.141 15);
  --av-rose-900: oklch(33% 0.106 15);
  --av-rose-950: oklch(24% 0.074 15);
  /* red (27) */
  --av-red-50: oklch(97% 0.015 27);
  --av-red-100: oklch(94% 0.03 27);
  --av-red-200: oklch(89% 0.057 27);
  --av-red-300: oklch(82% 0.095 27);
  --av-red-400: oklch(72% 0.141 27);
  --av-red-500: oklch(63% 0.177 27);
  --av-red-600: oklch(50% 0.19 27);
  --av-red-700: oklch(47% 0.173 27);
  --av-red-800: oklch(40% 0.141 27);
  --av-red-900: oklch(33% 0.106 27);
  --av-red-950: oklch(24% 0.074 27);
  /* orange (55) */
  --av-orange-50: oklch(97% 0.015 55);
  --av-orange-100: oklch(94% 0.03 55);
  --av-orange-200: oklch(89% 0.057 55);
  --av-orange-300: oklch(82% 0.095 55);
  --av-orange-400: oklch(72% 0.141 55);
  --av-orange-500: oklch(63% 0.177 55);
  --av-orange-600: oklch(50% 0.19 55);
  --av-orange-700: oklch(47% 0.173 55);
  --av-orange-800: oklch(40% 0.141 55);
  --av-orange-900: oklch(33% 0.106 55);
  --av-orange-950: oklch(24% 0.074 55);
  /* amber (75) */
  --av-amber-50: oklch(97% 0.015 75);
  --av-amber-100: oklch(94% 0.03 75);
  --av-amber-200: oklch(89% 0.057 75);
  --av-amber-300: oklch(82% 0.095 75);
  --av-amber-400: oklch(72% 0.141 75);
  --av-amber-500: oklch(63% 0.177 75);
  --av-amber-600: oklch(50% 0.19 75);
  --av-amber-700: oklch(47% 0.173 75);
  --av-amber-800: oklch(40% 0.141 75);
  --av-amber-900: oklch(33% 0.106 75);
  --av-amber-950: oklch(24% 0.074 75);
  /* yellow (95) */
  --av-yellow-50: oklch(97% 0.015 95);
  --av-yellow-100: oklch(94% 0.03 95);
  --av-yellow-200: oklch(89% 0.057 95);
  --av-yellow-300: oklch(82% 0.095 95);
  --av-yellow-400: oklch(72% 0.141 95);
  --av-yellow-500: oklch(63% 0.177 95);
  --av-yellow-600: oklch(50% 0.19 95);
  --av-yellow-700: oklch(47% 0.173 95);
  --av-yellow-800: oklch(40% 0.141 95);
  --av-yellow-900: oklch(33% 0.106 95);
  --av-yellow-950: oklch(24% 0.074 95);
  /* lime (130) */
  --av-lime-50: oklch(97% 0.015 130);
  --av-lime-100: oklch(94% 0.03 130);
  --av-lime-200: oklch(89% 0.057 130);
  --av-lime-300: oklch(82% 0.095 130);
  --av-lime-400: oklch(72% 0.141 130);
  --av-lime-500: oklch(63% 0.177 130);
  --av-lime-600: oklch(50% 0.19 130);
  --av-lime-700: oklch(47% 0.173 130);
  --av-lime-800: oklch(40% 0.141 130);
  --av-lime-900: oklch(33% 0.106 130);
  --av-lime-950: oklch(24% 0.074 130);
  /* green (150) */
  --av-green-50: oklch(97% 0.015 150);
  --av-green-100: oklch(94% 0.03 150);
  --av-green-200: oklch(89% 0.057 150);
  --av-green-300: oklch(82% 0.095 150);
  --av-green-400: oklch(72% 0.141 150);
  --av-green-500: oklch(63% 0.177 150);
  --av-green-600: oklch(50% 0.19 150);
  --av-green-700: oklch(47% 0.173 150);
  --av-green-800: oklch(40% 0.141 150);
  --av-green-900: oklch(33% 0.106 150);
  --av-green-950: oklch(24% 0.074 150);
  /* emerald (165) */
  --av-emerald-50: oklch(97% 0.015 165);
  --av-emerald-100: oklch(94% 0.03 165);
  --av-emerald-200: oklch(89% 0.057 165);
  --av-emerald-300: oklch(82% 0.095 165);
  --av-emerald-400: oklch(72% 0.141 165);
  --av-emerald-500: oklch(63% 0.177 165);
  --av-emerald-600: oklch(50% 0.19 165);
  --av-emerald-700: oklch(47% 0.173 165);
  --av-emerald-800: oklch(40% 0.141 165);
  --av-emerald-900: oklch(33% 0.106 165);
  --av-emerald-950: oklch(24% 0.074 165);
  /* teal (180) */
  --av-teal-50: oklch(97% 0.015 180);
  --av-teal-100: oklch(94% 0.03 180);
  --av-teal-200: oklch(89% 0.057 180);
  --av-teal-300: oklch(82% 0.095 180);
  --av-teal-400: oklch(72% 0.141 180);
  --av-teal-500: oklch(63% 0.177 180);
  --av-teal-600: oklch(50% 0.19 180);
  --av-teal-700: oklch(47% 0.173 180);
  --av-teal-800: oklch(40% 0.141 180);
  --av-teal-900: oklch(33% 0.106 180);
  --av-teal-950: oklch(24% 0.074 180);
  /* cyan (210) */
  --av-cyan-50: oklch(97% 0.015 210);
  --av-cyan-100: oklch(94% 0.03 210);
  --av-cyan-200: oklch(89% 0.057 210);
  --av-cyan-300: oklch(82% 0.095 210);
  --av-cyan-400: oklch(72% 0.141 210);
  --av-cyan-500: oklch(63% 0.177 210);
  --av-cyan-600: oklch(50% 0.19 210);
  --av-cyan-700: oklch(47% 0.173 210);
  --av-cyan-800: oklch(40% 0.141 210);
  --av-cyan-900: oklch(33% 0.106 210);
  --av-cyan-950: oklch(24% 0.074 210);
  /* sky (235) */
  --av-sky-50: oklch(97% 0.015 235);
  --av-sky-100: oklch(94% 0.03 235);
  --av-sky-200: oklch(89% 0.057 235);
  --av-sky-300: oklch(82% 0.095 235);
  --av-sky-400: oklch(72% 0.141 235);
  --av-sky-500: oklch(63% 0.177 235);
  --av-sky-600: oklch(50% 0.19 235);
  --av-sky-700: oklch(47% 0.173 235);
  --av-sky-800: oklch(40% 0.141 235);
  --av-sky-900: oklch(33% 0.106 235);
  --av-sky-950: oklch(24% 0.074 235);
  /* neutral (258 @ C 0.008, extended) */
  --av-neutral-0: oklch(100% 0 258);
  --av-neutral-50: oklch(97% 0.001 258);
  --av-neutral-100: oklch(94% 0.001 258);
  --av-neutral-200: oklch(89% 0.002 258);
  --av-neutral-300: oklch(82% 0.004 258);
  --av-neutral-350: oklch(77% 0.005 258);
  --av-neutral-400: oklch(72% 0.006 258);
  --av-neutral-500: oklch(63% 0.007 258);
  --av-neutral-600: oklch(50% 0.008 258);
  --av-neutral-700: oklch(47% 0.007 258);
  --av-neutral-750: oklch(43.5% 0.007 258);
  --av-neutral-800: oklch(40% 0.006 258);
  --av-neutral-850: oklch(36.5% 0.005 258);
  --av-neutral-900: oklch(33% 0.004 258);
  --av-neutral-925: oklch(28.5% 0.004 258);
  --av-neutral-950: oklch(24% 0.003 258);

  /* Default brand ramp (aurora / blue) — presets override --av-primary-* */
  --av-primary-50: oklch(97% 0.015 258);
  --av-primary-100: oklch(94% 0.03 258);
  --av-primary-200: oklch(89% 0.057 258);
  --av-primary-300: oklch(82% 0.095 258);
  --av-primary-400: oklch(72% 0.141 258);
  --av-primary-500: oklch(63% 0.176 258);
  --av-primary-600: oklch(55% 0.190 258);
  --av-primary-700: oklch(47% 0.172 258);
  --av-primary-800: oklch(40% 0.141 258);
  --av-primary-900: oklch(33% 0.106 258);
  --av-primary-950: oklch(24% 0.074 258);
  --av-accent-500: oklch(66% 0.160 195);

  /* Spacing — 4pt grid × density */
  --av-density: 1;
  --av-space-0: 0;
  --av-space-1: calc(0.25rem * var(--av-density));
  --av-space-2: calc(0.5rem * var(--av-density));
  --av-space-3: calc(0.75rem * var(--av-density));
  --av-space-4: calc(1rem * var(--av-density));
  --av-space-5: calc(1.25rem * var(--av-density));
  --av-space-6: calc(1.5rem * var(--av-density));
  --av-space-7: calc(1.75rem * var(--av-density));
  --av-space-8: calc(2rem * var(--av-density));
  --av-space-10: calc(2.5rem * var(--av-density));
  --av-space-12: calc(3rem * var(--av-density));
  --av-space-16: calc(4rem * var(--av-density));
  --av-space-20: calc(5rem * var(--av-density));
  --av-space-24: calc(6rem * var(--av-density));
  --av-space-32: calc(8rem * var(--av-density));
  --av-space-px: 1px;
  --av-space-0-5: calc(0.125rem * var(--av-density));
  --av-space-1-5: calc(0.375rem * var(--av-density));
  --av-space-2-5: calc(0.625rem * var(--av-density));
  --av-space-3-5: calc(0.875rem * var(--av-density));

  /* Radius × scale (data-av-radius) */
  --av-radius-scale: 1;
  --av-radius-none: 0;
  --av-radius-xs: calc(0.25rem * var(--av-radius-scale));
  --av-radius-sm: calc(0.375rem * var(--av-radius-scale));
  --av-radius-md: calc(0.5rem * var(--av-radius-scale));
  --av-radius-lg: calc(0.75rem * var(--av-radius-scale));
  --av-radius-xl: calc(1rem * var(--av-radius-scale));
  --av-radius-2xl: calc(1.5rem * var(--av-radius-scale));
  --av-radius-3xl: calc(2rem * var(--av-radius-scale));
  --av-radius-full: 9999px;

  /* Typography */
  --av-font-sans: 'InterVariable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --av-font-display: 'PlusJakartaSansVariable', var(--av-font-sans);
  --av-font-serif: 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --av-font-mono: 'JetBrainsMonoVariable', ui-monospace, 'Cascadia Code', 'SF Mono', monospace;
  --av-font-size-2xs: 0.625rem;
  --av-font-size-xs: 0.75rem;
  --av-font-size-sm: 0.875rem;
  --av-font-size-base: 1rem;
  --av-font-size-lg: 1.125rem;
  --av-font-size-xl: 1.25rem;
  --av-font-size-2xl: 1.5rem;
  --av-font-size-3xl: 1.875rem;
  --av-font-size-4xl: 2.25rem;
  --av-font-size-5xl: 3rem;
  --av-font-size-6xl: 3.75rem;
  --av-font-size-7xl: 4.5rem;
  --av-font-weight-light: 300;
  --av-font-weight-normal: 400;
  --av-font-weight-medium: 500;
  --av-font-weight-semibold: 600;
  --av-font-weight-bold: 700;
  --av-font-weight-extrabold: 800;
  --av-font-weight-black: 900;
  --av-line-height-none: 1;
  --av-line-height-tight: 1.25;
  --av-line-height-snug: 1.375;
  --av-line-height-normal: 1.5;
  --av-line-height-relaxed: 1.625;
  --av-line-height-loose: 2;
  --av-tracking-tighter: -0.05em;
  --av-tracking-tight: -0.025em;
  --av-tracking-normal: 0;
  --av-tracking-wide: 0.025em;
  --av-tracking-wider: 0.05em;
  --av-tracking-widest: 0.1em;

  /* Shadows — hue-tinted near-black, per theme (L C H triplet) */
  --av-shadow-color: 15% 0.012 258;
  /* The counterpart: the light catching a raised edge, as an inset top
     highlight. Same L C H triplet form as the shadow so both are used the same
     way, oklch(var(--av-highlight-color) / .06), with the alpha chosen per
     component — how much edge a surface catches is a property of the surface,
     not of the theme. Barely visible on white, and doing most of the work in
     dark, where a raised surface has no shadow contrast left to spend. */
  --av-highlight-color: 100% 0 0;

  /* The scrim behind anything modal — dialog, drawer, command palette, the
     off-canvas sidebar's backdrop, a lightbox. It was a literal repeated at five
     sites and had already drifted into three different values: two alphas and a
     hue that had lost its tint entirely. Nothing caught it, because lint:css
     required a token for background-color and not for the background
     shorthand, which is how every one of them was written.

     Built on the shadow triplet rather than a fresh colour: the scrim and the
     shadow are the same absence of light, and a theme that warms one should warm
     the other. The alpha is a separate custom property so a component can go heavier
     without restating the colour: the palette wants less, being a smaller
     surface over a page you are still reading. */
  --av-overlay-alpha: .55;
  --av-overlay: oklch(var(--av-shadow-color) / var(--av-overlay-alpha));

  /* The ground behind media. Letterboxing is meant to disappear, so this is the
     one surface that does *not* follow the mode — a pale well around a
     photograph reads as a rendering fault rather than as a frame. It is still a
     token rather than a literal because "always black" is a design decision, and
     a preset built around sepia or a warm cinema black should be able to say so
     in one place instead of hunting the value through a plugin partial. */
  --av-media-well: oklch(0% 0 0);

  --av-shadow-xs: 0 1px 2px 0 oklch(var(--av-shadow-color) / .05);
  --av-shadow-sm: 0 1px 2px -1px oklch(var(--av-shadow-color) / .06), 0 1px 3px 0 oklch(var(--av-shadow-color) / .10);
  --av-shadow-md: 0 2px 4px -2px oklch(var(--av-shadow-color) / .06), 0 4px 12px -2px oklch(var(--av-shadow-color) / .10);
  --av-shadow-lg: 0 4px 6px -4px oklch(var(--av-shadow-color) / .05), 0 10px 24px -4px oklch(var(--av-shadow-color) / .12);
  --av-shadow-xl: 0 8px 10px -6px oklch(var(--av-shadow-color) / .05), 0 20px 40px -8px oklch(var(--av-shadow-color) / .14);
  --av-shadow-2xl: 0 32px 64px -12px oklch(var(--av-shadow-color) / .22);
  --av-shadow-inner: inset 0 2px 4px 0 oklch(var(--av-shadow-color) / .05);

  /* Motion */
  --av-duration-instant: 0ms;
  --av-duration-fastest: 80ms;
  --av-duration-fast: 140ms;
  --av-duration-normal: 220ms;
  --av-duration-slow: 320ms;
  --av-duration-slower: 480ms;
  --av-ease-linear: linear;
  --av-ease-standard: cubic-bezier(.2, 0, 0, 1);
  --av-ease-decelerate: cubic-bezier(0, 0, 0, 1);
  --av-ease-accelerate: cubic-bezier(.3, 0, 1, 1);
  --av-ease-emphasized: cubic-bezier(.2, 0, 0, 1);
  --av-ease-spring: linear(0, .68 28%, 1.03 46%, .995 70%, 1);

  /* Z-index scale */
  --av-z-below: -1;
  --av-z-base: 0;
  --av-z-raised: 10;
  --av-z-sticky: 100;
  --av-z-topbar: 1020;
  --av-z-sidebar: 1030;
  --av-z-backdrop: 1040;
  --av-z-drawer: 1045;
  --av-z-modal: 1055;
  --av-z-popover: 1070;
  --av-z-tooltip: 1080;
  --av-z-toast: 1090;
  --av-z-palette: 1100;
  --av-z-max: 2147483647;

  /* Focus */
  --av-focus-color: var(--av-color-primary);
  --av-focus-width: 2px;
  --av-focus-offset: 2px;
  --av-focus-ring: 0 0 0 var(--av-focus-width) var(--av-focus-color);

  /* Depth ─────────────────────────────────────────────────────────────
     Every value below is derived from --av-color-primary / --av-accent-500,
     which each preset redefines, so the whole depth layer re-themes with the
     preset and no component ever names a colour. Custom properties resolve at
     use time, so referring to Tier-2 semantics from here is fine.

     The brand gradient keeps --av-color-primary as its MID stop and lets only
     the ends drift. tests/contrast.mjs measures the button label against that
     token rather than against a painted pixel, so a gradient whose ends stray
     far in lightness would pass the gate while failing on screen. */
  --av-gradient-brand: linear-gradient(135deg,
    color-mix(in oklab, var(--av-accent-500) 30%, var(--av-color-primary)) 0%,
    var(--av-color-primary) 55%,
    color-mix(in oklab, var(--av-color-primary-active) 35%, var(--av-color-primary)) 100%);
  --av-gradient-brand-soft: linear-gradient(135deg,
    color-mix(in oklab, var(--av-color-primary) 10%, transparent) 0%,
    color-mix(in oklab, var(--av-accent-500) 10%, transparent) 100%);
  --av-gradient-sheen: linear-gradient(120deg,
    oklch(100% 0 0 / .22) 0%, oklch(100% 0 0 / 0) 55%);

  /* Coloured glows. Alpha is deliberately low: a glow reads as depth, not as a
     second border, and these sit under real shadows rather than replacing them. */
  --av-glow-primary: 0 4px 20px color-mix(in oklab, var(--av-color-primary) 30%, transparent);
  --av-glow-success: 0 4px 16px color-mix(in oklab, var(--av-color-success) 32%, transparent);
  --av-glow-warning: 0 4px 16px color-mix(in oklab, var(--av-color-warning) 32%, transparent);
  --av-glow-danger: 0 4px 16px color-mix(in oklab, var(--av-color-danger) 32%, transparent);
  --av-glow-info: 0 4px 16px color-mix(in oklab, var(--av-color-info) 32%, transparent);

  /* Ambient page mesh — three washes painted on the page background. */
  --av-mesh-a: radial-gradient(ellipse 80% 50% at 0% 0%,
    color-mix(in oklab, var(--av-color-primary) 6%, transparent) 0%, transparent 60%);
  --av-mesh-b: radial-gradient(ellipse 60% 40% at 100% 0%,
    color-mix(in oklab, var(--av-accent-500) 5%, transparent) 0%, transparent 55%);
  --av-mesh-c: radial-gradient(ellipse 50% 60% at 50% 100%,
    color-mix(in oklab, var(--av-color-primary) 4%, transparent) 0%, transparent 60%);

  /* Frosted surfaces */
  --av-glass-bg: color-mix(in oklab, var(--av-surface-raised) 78%, transparent);
  --av-glass-border: color-mix(in oklab, var(--av-neutral-0) 60%, var(--av-border-subtle));
  --av-glass-blur: 16px;

  /* How far an interactive surface rises on hover. The motion axis zeroes it,
     so "does this theme move?" is answered in one place rather than per rule.
     A hoverless pointer zeroes it in the same place, for the reason below. */
  --av-lift: -2px;
  --av-lift-sm: -1px;

  /* The smallest a control may be under a finger. WCAG 2.2 SC 2.5.8 asks for
     24 CSS px; a mouse can hit less, a fingertip covers about 9 mm and cannot
     aim at what it is covering. Applied only under a coarse pointer, because
     growing every checkbox on a desktop to touch size makes dense screens
     worse for the pointer that is actually in use. */
  --av-size-touch-min: 24px;

  /* Control heights. One scale for every control that sits in a row with
     another (buttons, inputs, selects, segmented controls, toolbars), so a
     button beside a field is the same height by construction rather than by
     two numbers that happen to agree; they did not (44 against 40). Density
     and a coarse pointer scale all five together. */
  --av-control-scale: 1;
  --av-control-2xs: calc(24px * var(--av-control-scale));
  --av-control-xs: calc(28px * var(--av-control-scale));
  --av-control-sm: calc(32px * var(--av-control-scale));
  --av-control-md: calc(40px * var(--av-control-scale));
  --av-control-lg: calc(48px * var(--av-control-scale));

  /* KPI tile recipe (see tools/styles.mjs). The default is the outline tile;
     a style states its own. */
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 12%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 3px;

  /* Chart style, read by the runtime's chart module (see tools/styles.mjs). */
  --av-chart-radius: 4;
  --av-chart-dash: 4;
  --av-chart-stroke: 2.5;
  --av-chart-area: .35;
  --av-chart-curve: smooth;

  /* A noise layer on the page canvas, set by the paper and tactile materials. */
  --av-grain: none;
}

/* A fingertip needs the larger controls; density still wins when it is set. */
@media (pointer: coarse) {
  :root { --av-control-scale: 1.1; }
}

/* ── Axis: density ───────────────────────────────────────────────────── */
[data-av-density="compact"]     { --av-density: 0.8; --av-control-scale: 0.9; }
[data-av-density="comfortable"] { --av-density: 1; }
[data-av-density="spacious"]    { --av-density: 1.15; --av-control-scale: 1.1; }

/* ── Axis: radius ────────────────────────────────────────────────────── */
[data-av-radius="sharp"]   { --av-radius-scale: 0; }
[data-av-radius="subtle"]  { --av-radius-scale: 0.5; }
[data-av-radius="rounded"] { --av-radius-scale: 1; }
[data-av-radius="pill"]    { --av-radius-scale: 1.6; }

/* ── Axis: motion ────────────────────────────────────────────────────── */
[data-av-motion="reduced"], [data-av-motion="off"] {
  --av-duration-fastest: 0ms;
  --av-duration-fast: 0ms;
  --av-duration-normal: 0ms;
  --av-duration-slow: 0ms;
  --av-duration-slower: 0ms;
  /* A hover lift is movement, not decoration: zero it here so every component
     that raises on hover stops moving from one place. */
  --av-lift: 0px;
  --av-lift-sm: 0px;
}

/* ── Pointer: no hover ───────────────────────────────────────────────────
   A hover lift on a touchscreen is not a hover state — it is a state the
   finger leaves behind. :hover still matches after a tap, until the next tap
   lands somewhere else, so a tapped card stays raised with nothing raising it
   and reads as selected.

   Zeroed here rather than wrapped in a hover-capable media query at each of the
   twelve rules that lift, for the same reason the motion axis is: the lift
   already funnels through one pair of custom properties, so "does this rise
   under a finger?" stays one question with one answer. The rules keep their
   :hover selector and simply translate by zero.

   Colour-only hover states are deliberately left alone. They also persist
   after a tap, but that is how every website behaves on a touchscreen, a tint
   is self-evidently not a control, and neutralising 123 declarations to fight
   the platform would cost more than it buys. */
@media (hover: none) {
  :root {
    --av-lift: 0px;
    --av-lift-sm: 0px;
  }
}

/* ── Tier 2 · Semantic — light ───────────────────────────────────────── */
/* Declared on every `[data-av-preset]` as well as on :root. A custom property
   that names another resolves where it is declared, and descendants inherit the
   result, so a semantic token declared only on :root carries the page's preset
   into every subtree. Re-declaring it on the scoped element makes it resolve
   against that element's own primitives: a preset on a card, a tenant panel or
   a customiser chip is then a real preset, not a recoloured ramp under the
   page's buttons. Emitted before the presets, so a preset's own value wins. */
:root,
[data-av-preset] {
  --av-surface-base: var(--av-neutral-50);
  --av-surface-raised: var(--av-neutral-0);
  --av-surface-overlay: var(--av-neutral-0);
  --av-surface-sunken: var(--av-neutral-100);
  --av-surface-inverse: var(--av-neutral-900);
  --av-surface-float: var(--av-neutral-0);
  --av-surface-accent-subtle: var(--av-primary-50);
  --av-surface-disabled: var(--av-neutral-100);

  --av-text-primary: var(--av-neutral-900);
  /* 750, not 700. Once step 600 moved to L 50 so that --av-text-muted clears 4.5:1,
     secondary at 700 (L 47) sat three points off muted — two tiers that measure
     differently and read identically. 750 is L 43.5 and already exists in the extended
     ramp, so the gap is restored without moving another step and without touching the
     dark block, where secondary is neutral-300. The tiers are L 33 / 43.5 / 50: heading,
     body, quiet, all above AA and all visibly apart. */
  --av-text-secondary: var(--av-neutral-750);
  --av-text-muted: var(--av-neutral-600);
  --av-text-subtle: var(--av-neutral-500);
  --av-text-disabled: var(--av-neutral-400);
  --av-text-inverse: var(--av-neutral-0);
  --av-text-link: var(--av-primary-600);
  --av-text-on-primary: var(--av-neutral-0);

  --av-border-subtle: var(--av-neutral-200);
  --av-border-default: var(--av-neutral-300);
  --av-border-strong: var(--av-neutral-400);
  --av-border-inverse: var(--av-neutral-700);
  --av-border-focus: var(--av-primary-500);

  --av-color-primary: var(--av-primary-600);
  --av-color-primary-hover: var(--av-primary-700);
  --av-color-primary-active: var(--av-primary-800);
  --av-color-primary-subtle: var(--av-primary-50);
  --av-color-primary-border: var(--av-primary-200);
  --av-color-primary-text: var(--av-primary-800);

  --av-color-secondary: var(--av-neutral-600);
  --av-color-secondary-hover: var(--av-neutral-700);
  --av-color-secondary-subtle: var(--av-neutral-100);
  --av-color-secondary-border: var(--av-neutral-300);
  --av-color-secondary-text: var(--av-neutral-700);

  --av-color-success: var(--av-green-600);
  --av-color-success-hover: var(--av-green-700);
  --av-color-success-subtle: var(--av-green-50);
  --av-color-success-border: var(--av-green-200);
  --av-color-success-text: var(--av-green-800);

  --av-color-warning: var(--av-amber-500);
  --av-color-warning-hover: var(--av-amber-600);
  --av-color-warning-subtle: var(--av-amber-50);
  --av-color-warning-border: var(--av-amber-200);
  --av-color-warning-text: var(--av-amber-900);

  --av-color-danger: var(--av-red-600);
  --av-color-danger-hover: var(--av-red-700);
  --av-color-danger-subtle: var(--av-red-50);
  --av-color-danger-border: var(--av-red-200);
  --av-color-danger-text: var(--av-red-800);

  --av-color-info: var(--av-sky-600);
  --av-color-info-hover: var(--av-sky-700);
  --av-color-info-subtle: var(--av-sky-50);
  --av-color-info-border: var(--av-sky-200);
  --av-color-info-text: var(--av-sky-800);

  --av-text-on-success: var(--av-neutral-0);
  --av-text-on-warning: var(--av-neutral-950);
  --av-text-on-danger: var(--av-neutral-0);
  --av-text-on-info: var(--av-neutral-0);
  --av-color-neutral: var(--av-neutral-600);
  --av-color-neutral-subtle: var(--av-neutral-100);
  --av-color-neutral-border: var(--av-neutral-300);
  --av-color-neutral-text: var(--av-neutral-700);

  /* Sidebar ───────────────────────────────────────────────────────────
     The sidebar gets its own semantic slice rather than reading the page
     surfaces directly, because a theme may want it to disagree with the page:
     an ink rail beside a light canvas is the single strongest thing a preset
     can do, and without these tokens every rule in layout/_sidebar.scss would
     have to name a colour to get it. Each one defaults to the page semantic it
     replaces, so a preset that says nothing is unchanged, and because they
     resolve at use time they follow light/dark for free. */
  --av-sidebar-bg: var(--av-surface-raised);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-text: var(--av-text-secondary);
  --av-sidebar-text-strong: var(--av-text-primary);
  /* The section captions are 10px, uppercase and tracked out — small text by any
     measure, so 4.5:1 applies. --av-text-subtle put every preset at ~3.5:1; the
     quietness has to come from the size and the tracking, which it already does,
     not from taking the contrast below the floor. */
  --av-sidebar-title: var(--av-text-muted);
  --av-sidebar-hover-bg: var(--av-surface-sunken);
  --av-sidebar-active-bg: var(--av-color-primary-subtle);
  --av-sidebar-active-text: var(--av-color-primary-text);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-border-strong);
  /* The rail's own brand pair, used by the upgrade button and the count badges.
     They are separate from --av-color-primary because a theme whose primary is
     ink paints both of those invisibly on an ink rail. */
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
  /* The active row's sweep is tinted from these two so an ink rail tints the
     sweep with its own ink rather than with the page's. */
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-color-primary) 14%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 5%, transparent);

  /* Chart series and KPI tiles: aurora's curated palette, so a page with no
     preset attribute draws what the aurora preset does. Tile 1 is the primary
     in every preset; 2 to 4 are palette series 2 to 4. */
  --av-chart-1: oklch(55% 0.19 262);
  --av-chart-2: oklch(56% 0.13 155);
  --av-chart-3: oklch(56% 0.17 300);
  --av-chart-4: oklch(60% 0.14 55);
  --av-chart-5: oklch(58% 0.11 235);
  --av-chart-6: oklch(58% 0.11 195);
  --av-chart-7: oklch(57% 0.16 15);
  --av-chart-8: oklch(50% 0.05 262);
  --av-chart-9: oklch(67% 0.152 262);
  --av-chart-10: oklch(68% 0.104 155);
  --av-tile-2: oklch(56% 0.13 155);
  --av-tile-3: oklch(56% 0.17 300);
  --av-tile-4: oklch(60% 0.14 55);
  --av-tile-1: var(--av-color-primary);

  color-scheme: light;
}

/* ── Tier 2 · Semantic — dark ────────────────────────────────────────── */
/* The same scoping, in dark. The 0-2-0 forms also keep a preset's light-mode
   values out of dark mode on <html>, which emitMirrored otherwise has to do
   key by key; a preset's own dark block is 0-2-0 and later, so it still wins. */
[data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset],
[data-av-preset][data-bs-theme="dark"] {
  --av-surface-base: var(--av-neutral-950);
  --av-surface-raised: var(--av-neutral-900);
  --av-surface-overlay: var(--av-neutral-850);
  --av-surface-sunken: var(--av-neutral-925);
  --av-surface-inverse: var(--av-neutral-50);
  --av-surface-float: var(--av-neutral-800);
  --av-surface-accent-subtle: var(--av-primary-950);
  --av-surface-disabled: var(--av-neutral-850);

  --av-text-primary: var(--av-neutral-50);
  --av-text-secondary: var(--av-neutral-300);
  /* 350, not 400: see the neutral ramp. 400 fell under 4.5:1 on --av-surface-overlay. */
  --av-text-muted: var(--av-neutral-350);
  --av-text-subtle: var(--av-neutral-500);
  --av-text-disabled: var(--av-neutral-600);
  --av-text-inverse: var(--av-neutral-950);
  --av-text-link: var(--av-primary-400);

  --av-border-subtle: var(--av-neutral-800);
  --av-border-default: var(--av-neutral-750);
  /* 500, not 600. Step 600 was darkened from L 55 to L 50 so that --av-text-muted
     clears 4.5:1 on every surface in light mode; in *dark* mode the same step is a
     border, and darkening a border on a dark ground makes it less visible, not more.
     One ramp serves both modes in opposite directions, which is why the fix for a
     light-mode text failure has to be checked against every dark-mode use of the
     step it moves. */
  --av-border-strong: var(--av-neutral-500);
  --av-border-inverse: var(--av-neutral-300);
  --av-border-focus: var(--av-primary-400);

  /* Solid fills lighten in dark mode. Step 500 was measured against both white and
     near-black across all nine presets and fails 4.5:1 for ember and grape; step 400
     clears 6.2:1 everywhere with near-black text, so the fill lands there and
     --av-text-on-primary is computed per preset by this build. */
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-on-primary: var(--av-neutral-950);
  --av-color-primary-subtle: var(--av-primary-950);
  --av-color-primary-border: var(--av-primary-800);
  --av-color-primary-text: var(--av-primary-300);

  --av-color-secondary: var(--av-neutral-400);
  --av-color-secondary-hover: var(--av-neutral-300);
  --av-color-secondary-subtle: var(--av-neutral-850);
  --av-color-secondary-border: var(--av-neutral-700);
  --av-color-secondary-text: var(--av-neutral-300);

  --av-color-success: var(--av-green-500);
  --av-color-success-hover: var(--av-green-400);
  --av-color-success-subtle: var(--av-green-950);
  --av-color-success-border: var(--av-green-800);
  --av-color-success-text: var(--av-green-300);

  --av-color-warning: var(--av-amber-500);
  --av-color-warning-hover: var(--av-amber-400);
  --av-color-warning-subtle: var(--av-amber-950);
  --av-color-warning-border: var(--av-amber-800);
  --av-color-warning-text: var(--av-amber-300);

  /* 400, not 500 — see ON_ROLE. Neither white nor near-black clears 4.5:1 on red-500
     in dark mode, so the fill moves rather than the ink. */
  --av-color-danger: var(--av-red-400);
  --av-color-danger-hover: var(--av-red-300);
  --av-color-danger-subtle: var(--av-red-950);
  --av-color-danger-border: var(--av-red-800);
  --av-color-danger-text: var(--av-red-300);

  --av-color-info: var(--av-sky-500);
  --av-color-info-hover: var(--av-sky-400);
  --av-color-info-subtle: var(--av-sky-950);
  --av-color-info-border: var(--av-sky-800);
  --av-color-info-text: var(--av-sky-300);

  --av-text-on-success: var(--av-neutral-950);
  --av-text-on-warning: var(--av-neutral-950);
  --av-text-on-danger: var(--av-neutral-950);
  --av-text-on-info: var(--av-neutral-950);
  --av-color-neutral: var(--av-neutral-400);
  --av-color-neutral-subtle: var(--av-neutral-850);
  --av-color-neutral-border: var(--av-neutral-700);
  --av-color-neutral-text: var(--av-neutral-300);

  --av-shadow-color: 5% 0.01 258;
  --av-highlight-color: 100% 0 0;

  /* Depth — dark mode. The mesh is pushed roughly 4x because a wash that reads
     as a tint on white disappears entirely on a near-black ground, and the
     glass border flips from a white highlight to a faint light edge. */
  --av-mesh-a: radial-gradient(ellipse 75% 55% at 0% 0%,
    color-mix(in oklab, var(--av-color-primary) 22%, transparent) 0%, transparent 55%);
  --av-mesh-b: radial-gradient(ellipse 65% 45% at 100% 0%,
    color-mix(in oklab, var(--av-accent-500) 18%, transparent) 0%, transparent 55%);
  --av-mesh-c: radial-gradient(ellipse 55% 65% at 50% 100%,
    color-mix(in oklab, var(--av-color-primary) 14%, transparent) 0%, transparent 60%);
  --av-glass-bg: color-mix(in oklab, var(--av-surface-raised) 74%, transparent);
  --av-glass-border: color-mix(in oklab, var(--av-neutral-0) 8%, var(--av-border-subtle));

  /* Lifted into a band that reads on a dark card; see darkPalette(). */
  --av-chart-1: oklch(69% 0.18 262);
  --av-chart-2: oklch(70% 0.123 155);
  --av-chart-3: oklch(70% 0.162 300);
  --av-chart-4: oklch(74% 0.133 55);
  --av-chart-5: oklch(72% 0.104 235);
  --av-chart-6: oklch(72% 0.104 195);
  --av-chart-7: oklch(71% 0.152 15);
  --av-chart-8: oklch(66% 0.048 262);
  --av-chart-9: oklch(81% 0.144 262);
  --av-chart-10: oklch(82% 0.098 155);

  color-scheme: dark;
}

/* ── Axis: contrast ──────────────────────────────────────────────────── */
[data-av-contrast="high"] {
  --av-text-muted: var(--av-neutral-700);
  --av-text-subtle: var(--av-neutral-600);
  --av-border-subtle: var(--av-neutral-300);
  --av-border-default: var(--av-neutral-400);
  --av-focus-width: 3px;
}
[data-av-contrast="high"][data-bs-theme="dark"] {
  --av-text-muted: var(--av-neutral-300);
  --av-text-subtle: var(--av-neutral-400);
  --av-border-subtle: var(--av-neutral-700);
  --av-border-default: var(--av-neutral-600);
}

/* ── Presets ─────────────────────────────────────────────────────────── */
[data-av-preset="aurora"],
[data-av-preset="material"] {
  --av-primary-50: oklch(97% 0.015 258);
  --av-primary-100: oklch(94% 0.03 258);
  --av-primary-200: oklch(89% 0.057 258);
  --av-primary-300: oklch(82% 0.095 258);
  --av-primary-400: oklch(72% 0.141 258);
  --av-primary-500: oklch(63% 0.176 258);
  --av-primary-600: oklch(55% 0.190 258);
  --av-primary-700: oklch(47% 0.172 258);
  --av-primary-800: oklch(40% 0.141 258);
  --av-primary-900: oklch(33% 0.106 258);
  --av-primary-950: oklch(24% 0.074 258);
  --av-accent-500: oklch(66% 0.160 195);
  --av-neutral-0: oklch(100% 0 258);
  --av-neutral-50: oklch(97% 0.004 258);
  --av-neutral-100: oklch(94% 0.008 258);
  --av-neutral-200: oklch(89% 0.015 258);
  --av-neutral-300: oklch(82% 0.025 258);
  --av-neutral-350: oklch(77% 0.031 258);
  --av-neutral-400: oklch(72% 0.037 258);
  --av-neutral-500: oklch(63% 0.047 258);
  --av-neutral-600: oklch(50% 0.05 258);
  --av-neutral-700: oklch(47% 0.046 258);
  --av-neutral-750: oklch(43.5% 0.041 258);
  --av-neutral-800: oklch(40% 0.037 258);
  --av-neutral-850: oklch(36.5% 0.033 258);
  --av-neutral-900: oklch(33% 0.028 258);
  --av-neutral-925: oklch(28.5% 0.024 258);
  --av-neutral-950: oklch(24% 0.02 258);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(55% 0.19 262);
  --av-chart-2: oklch(56% 0.13 155);
  --av-chart-3: oklch(56% 0.17 300);
  --av-chart-4: oklch(60% 0.14 55);
  --av-chart-5: oklch(58% 0.11 235);
  --av-chart-6: oklch(58% 0.11 195);
  --av-chart-7: oklch(57% 0.16 15);
  --av-chart-8: oklch(50% 0.05 262);
  --av-chart-9: oklch(67% 0.152 262);
  --av-chart-10: oklch(68% 0.104 155);
  --av-tile-2: oklch(56% 0.13 155);
  --av-tile-3: oklch(56% 0.17 300);
  --av-tile-4: oklch(60% 0.14 55);
}
[data-av-preset="aurora"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="aurora"],
[data-av-preset="material"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="material"] {
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(69% 0.18 262);
  --av-chart-2: oklch(70% 0.123 155);
  --av-chart-3: oklch(70% 0.162 300);
  --av-chart-4: oklch(74% 0.133 55);
  --av-chart-5: oklch(72% 0.104 235);
  --av-chart-6: oklch(72% 0.104 195);
  --av-chart-7: oklch(71% 0.152 15);
  --av-chart-8: oklch(66% 0.048 262);
  --av-chart-9: oklch(81% 0.144 262);
  --av-chart-10: oklch(82% 0.098 155);
}

[data-av-preset="oxford"],
[data-av-preset="neon"],
[data-av-preset="grape"] {
  --av-primary-50: oklch(97% 0.004 246);
  --av-primary-100: oklch(94% 0.008 246);
  --av-primary-200: oklch(89% 0.015 246);
  --av-primary-300: oklch(82% 0.027 246);
  --av-primary-400: oklch(70% 0.031 250);
  --av-primary-500: oklch(59% 0.036 247);
  --av-primary-600: oklch(40% 0.046 246);
  --av-primary-700: oklch(31% 0.048 243);
  --av-primary-800: oklch(26% 0.046 243);
  --av-primary-900: oklch(22% 0.042 243);
  --av-primary-950: oklch(19% 0.04 243);
  --av-accent-500: oklch(76% 0.105 82);
  --av-neutral-0: oklch(100% 0 246);
  --av-neutral-50: oklch(97% 0.002 246);
  --av-neutral-100: oklch(94% 0.005 246);
  --av-neutral-200: oklch(89% 0.009 246);
  --av-neutral-300: oklch(82% 0.015 246);
  --av-neutral-350: oklch(77% 0.019 246);
  --av-neutral-400: oklch(72% 0.022 246);
  --av-neutral-500: oklch(63% 0.028 246);
  --av-neutral-600: oklch(50% 0.03 246);
  --av-neutral-700: oklch(47% 0.027 246);
  --av-neutral-750: oklch(43.5% 0.025 246);
  --av-neutral-800: oklch(40% 0.022 246);
  --av-neutral-850: oklch(36.5% 0.019 246);
  --av-neutral-900: oklch(33% 0.017 246);
  --av-neutral-925: oklch(28.5% 0.014 246);
  --av-neutral-950: oklch(24% 0.012 246);
  --av-shadow-color: 24% 0.045 246;
  --av-surface-base: oklch(93.5% 0.02 246);
  --av-surface-raised: oklch(97.5% 0.009 246);
  --av-surface-sunken: oklch(91% 0.025 246);
  --av-surface-overlay: oklch(97.5% 0.009 246);
  --av-sidebar-bg: oklch(35% 0.05 246);
  --av-sidebar-border: oklch(42% 0.055 246);
  --av-sidebar-text: oklch(91% 0.025 246);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(83% 0.03 246);
  --av-sidebar-hover-bg: oklch(40% 0.053 246);
  --av-sidebar-active-bg: oklch(45% 0.06 246);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: oklch(53% 0.05 246);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(31% 0.048 243);
  --av-chart-2: oklch(57% 0.11 78);
  --av-chart-3: oklch(50% 0.065 195);
  --av-chart-4: oklch(46% 0.1 30);
  --av-chart-5: oklch(56% 0.07 275);
  --av-chart-6: oklch(52% 0.07 140);
  --av-chart-7: oklch(42% 0.07 340);
  --av-chart-8: oklch(48% 0.02 250);
  --av-chart-9: oklch(43% 0.038 243);
  --av-chart-10: oklch(69% 0.088 78);
  --av-tile-2: oklch(57% 0.11 78);
  --av-tile-3: oklch(50% 0.065 195);
  --av-tile-4: oklch(46% 0.1 30);
}
[data-av-preset="oxford"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="oxford"],
[data-av-preset="neon"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="neon"],
[data-av-preset="grape"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="grape"] {
  --av-shadow-color: 5% 0.03 246;
  --av-surface-base: oklch(16.5% 0.032 245);
  --av-surface-raised: oklch(21% 0.038 245);
  --av-surface-sunken: oklch(14% 0.029 245);
  --av-surface-overlay: oklch(24.5% 0.042 245);
  --av-surface-float: oklch(27.5% 0.044 245);
  --av-sidebar-bg: oklch(19% 0.04 244);
  --av-sidebar-border: oklch(26% 0.044 244);
  --av-sidebar-text: oklch(82% 0.02 244);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.024 244);
  --av-sidebar-hover-bg: oklch(24% 0.042 244);
  --av-sidebar-active-bg: oklch(29% 0.048 244);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: oklch(76% 0.105 82);
  --av-sidebar-scroll-thumb: oklch(37% 0.04 244);
  --av-sidebar-sweep-from: color-mix(in oklab, oklch(76% 0.105 82) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, oklch(76% 0.105 82) 4%, transparent);
  --av-sidebar-cta-bg: oklch(76% 0.105 82);
  --av-sidebar-cta-text: oklch(20% 0.03 82);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-color-primary: oklch(78% 0.105 82);
  --av-color-primary-hover: oklch(83% 0.095 82);
  --av-color-primary-active: oklch(73% 0.105 82);
  --av-accent-500: oklch(80% 0.035 246);
  --av-metal: oklch(78% 0.105 82);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.046 243);
  --av-chart-2: oklch(71% 0.104 78);
  --av-chart-3: oklch(66% 0.062 195);
  --av-chart-4: oklch(66% 0.095 30);
  --av-chart-5: oklch(70% 0.067 275);
  --av-chart-6: oklch(66% 0.067 140);
  --av-chart-7: oklch(66% 0.067 340);
  --av-chart-8: oklch(66% 0.019 250);
  --av-chart-9: oklch(78% 0.037 243);
  --av-chart-10: oklch(83% 0.083 78);
}

[data-av-preset="pine"],
[data-av-preset="tidewater"],
[data-av-preset="ocean"],
[data-av-preset="harbour"] {
  --av-primary-50: oklch(97% 0.003 200);
  --av-primary-100: oklch(94% 0.006 200);
  --av-primary-200: oklch(89% 0.012 200);
  --av-primary-300: oklch(78% 0.02 205);
  --av-primary-400: oklch(65% 0.033 212);
  --av-primary-500: oklch(54% 0.036 200);
  --av-primary-600: oklch(42% 0.04 195);
  --av-primary-700: oklch(34% 0.026 205);
  --av-primary-800: oklch(30% 0.023 205);
  --av-primary-900: oklch(24% 0.018 208);
  --av-primary-950: oklch(20% 0.015 211);
  --av-accent-500: oklch(68% 0.12 50);
  --av-neutral-0: oklch(100% 0 207);
  --av-neutral-50: oklch(97% 0.001 207);
  --av-neutral-100: oklch(94% 0.003 207);
  --av-neutral-200: oklch(89% 0.005 207);
  --av-neutral-300: oklch(82% 0.009 207);
  --av-neutral-350: oklch(77% 0.011 207);
  --av-neutral-400: oklch(72% 0.013 207);
  --av-neutral-500: oklch(63% 0.017 207);
  --av-neutral-600: oklch(50% 0.018 207);
  --av-neutral-700: oklch(47% 0.016 207);
  --av-neutral-750: oklch(43.5% 0.015 207);
  --av-neutral-800: oklch(40% 0.013 207);
  --av-neutral-850: oklch(36.5% 0.012 207);
  --av-neutral-900: oklch(33% 0.01 207);
  --av-neutral-925: oklch(28.5% 0.009 207);
  --av-neutral-950: oklch(24% 0.007 207);
  --av-shadow-color: 18% 0.02 207;
  --av-surface-base: oklch(94.5% 0.006 200);
  --av-surface-raised: oklch(98.5% 0.003 200);
  --av-surface-sunken: oklch(92% 0.007 200);
  --av-surface-overlay: oklch(98.5% 0.003 200);
  --av-sidebar-bg: oklch(44% 0.032 206);
  --av-sidebar-border: oklch(50% 0.032 206);
  --av-sidebar-text: oklch(95% 0.006 206);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.01 206);
  --av-sidebar-hover-bg: oklch(49% 0.034 206);
  --av-sidebar-active-bg: oklch(95% 0.01 205);
  --av-sidebar-active-text: oklch(38% 0.032 206);
  --av-sidebar-marker: oklch(74% 0.12 50);
  --av-sidebar-scroll-thumb: oklch(61% 0.029 206);
  --av-sidebar-sweep-from: oklch(100% 0 0 / .16);
  --av-sidebar-sweep-to: oklch(100% 0 0 / .03);
  --av-sidebar-cta-bg: oklch(74% 0.12 50);
  --av-sidebar-cta-text: oklch(20% 0.03 50);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(38% 0.035 206);
  --av-chart-2: oklch(57% 0.12 48);
  --av-chart-3: oklch(50% 0.05 250);
  --av-chart-4: oklch(58% 0.09 85);
  --av-chart-5: oklch(45% 0.06 340);
  --av-chart-6: oklch(52% 0.06 140);
  --av-chart-7: oklch(46% 0.11 28);
  --av-chart-8: oklch(48% 0.012 207);
  --av-chart-9: oklch(50% 0.028 206);
  --av-chart-10: oklch(69% 0.096 48);
  --av-tile-2: oklch(57% 0.12 48);
  --av-tile-3: oklch(50% 0.05 250);
  --av-tile-4: oklch(58% 0.09 85);
}
[data-av-preset="pine"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="pine"],
[data-av-preset="tidewater"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="tidewater"],
[data-av-preset="ocean"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="ocean"],
[data-av-preset="harbour"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="harbour"] {
  --av-shadow-color: 4% 0.012 207;
  --av-surface-base: oklch(17.5% 0.014 210);
  --av-surface-raised: oklch(22% 0.017 210);
  --av-surface-sunken: oklch(15% 0.013 210);
  --av-surface-overlay: oklch(25.5% 0.018 210);
  --av-surface-float: oklch(28.5% 0.019 210);
  --av-sidebar-bg: oklch(15% 0.013 210);
  --av-sidebar-border: oklch(22% 0.014 210);
  --av-sidebar-text: oklch(82% 0.006 210);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.008 210);
  --av-sidebar-hover-bg: oklch(20% 0.014 210);
  --av-sidebar-active-bg: oklch(25% 0.016 210);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: oklch(72% 0.12 50);
  --av-sidebar-scroll-thumb: oklch(33% 0.013 210);
  --av-sidebar-sweep-from: color-mix(in oklab, oklch(72% 0.12 50) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, oklch(72% 0.12 50) 4%, transparent);
  --av-sidebar-cta-bg: oklch(72% 0.12 50);
  --av-sidebar-cta-text: oklch(20% 0.03 50);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-color-primary: oklch(72% 0.12 50);
  --av-color-primary-hover: oklch(77% 0.108 50);
  --av-color-primary-active: oklch(67% 0.12 50);
  --av-accent-500: oklch(78% 0.03 205);
  --av-metal: oklch(72% 0.12 50);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.033 206);
  --av-chart-2: oklch(71% 0.114 48);
  --av-chart-3: oklch(66% 0.048 250);
  --av-chart-4: oklch(72% 0.085 85);
  --av-chart-5: oklch(66% 0.057 340);
  --av-chart-6: oklch(66% 0.057 140);
  --av-chart-7: oklch(66% 0.104 28);
  --av-chart-8: oklch(66% 0.011 207);
  --av-chart-9: oklch(78% 0.026 206);
  --av-chart-10: oklch(83% 0.091 48);
}

[data-av-preset="matsuba"],
[data-av-preset="evergreen"],
[data-av-preset="forest"] {
  --av-primary-50: oklch(97% 0.005 124);
  --av-primary-100: oklch(94% 0.01 124);
  --av-primary-200: oklch(89% 0.018 124);
  --av-primary-300: oklch(82% 0.045 118);
  --av-primary-400: oklch(68% 0.06 117);
  --av-primary-500: oklch(55% 0.064 120);
  --av-primary-600: oklch(41% 0.055 125);
  --av-primary-700: oklch(34% 0.048 126);
  --av-primary-800: oklch(29% 0.041 126);
  --av-primary-900: oklch(24% 0.032 124);
  --av-primary-950: oklch(20% 0.025 123);
  --av-accent-500: oklch(80% 0.1 85);
  --av-neutral-0: oklch(100% 0 120);
  --av-neutral-50: oklch(97% 0.002 120);
  --av-neutral-100: oklch(94% 0.004 120);
  --av-neutral-200: oklch(89% 0.007 120);
  --av-neutral-300: oklch(82% 0.011 120);
  --av-neutral-350: oklch(77% 0.014 120);
  --av-neutral-400: oklch(72% 0.016 120);
  --av-neutral-500: oklch(63% 0.02 120);
  --av-neutral-600: oklch(50% 0.022 120);
  --av-neutral-700: oklch(47% 0.02 120);
  --av-neutral-750: oklch(43.5% 0.018 120);
  --av-neutral-800: oklch(40% 0.016 120);
  --av-neutral-850: oklch(36.5% 0.014 120);
  --av-neutral-900: oklch(33% 0.012 120);
  --av-neutral-925: oklch(28.5% 0.01 120);
  --av-neutral-950: oklch(24% 0.009 120);
  --av-shadow-color: 20% 0.035 125;
  --av-surface-base: oklch(95.5% 0.014 112);
  --av-surface-raised: oklch(99.4% 0.006 112);
  --av-surface-sunken: oklch(93% 0.018 112);
  --av-surface-overlay: oklch(99.4% 0.006 112);
  --av-sidebar-bg: oklch(36% 0.055 125);
  --av-sidebar-border: oklch(42% 0.055 125);
  --av-sidebar-text: oklch(95% 0.011 125);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.017 125);
  --av-sidebar-hover-bg: oklch(41% 0.058 125);
  --av-sidebar-active-bg: oklch(94% 0.035 105);
  --av-sidebar-active-text: oklch(30% 0.055 125);
  --av-sidebar-marker: oklch(94% 0.035 105);
  --av-sidebar-scroll-thumb: oklch(53% 0.05 125);
  --av-sidebar-sweep-from: oklch(100% 0 0 / .16);
  --av-sidebar-sweep-to: oklch(100% 0 0 / .03);
  --av-sidebar-cta-bg: oklch(94% 0.035 105);
  --av-sidebar-cta-text: oklch(30% 0.055 125);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(46% 0.06 125);
  --av-chart-2: oklch(60% 0.11 80);
  --av-chart-3: oklch(47% 0.107 52);
  --av-chart-4: oklch(59% 0.064 219);
  --av-chart-5: oklch(45% 0.067 348);
  --av-chart-6: oklch(58% 0.05 150);
  --av-chart-7: oklch(45% 0.04 60);
  --av-chart-8: oklch(50% 0.03 240);
  --av-chart-9: oklch(58% 0.048 125);
  --av-chart-10: oklch(72% 0.088 80);
  --av-tile-2: oklch(60% 0.11 80);
  --av-tile-3: oklch(47% 0.107 52);
  --av-tile-4: oklch(59% 0.064 219);
}
[data-av-preset="matsuba"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="matsuba"],
[data-av-preset="evergreen"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="evergreen"],
[data-av-preset="forest"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="forest"] {
  --av-shadow-color: 4% 0.02 125;
  --av-surface-base: oklch(17% 0.02 124);
  --av-surface-raised: oklch(21.5% 0.024 124);
  --av-surface-sunken: oklch(14.5% 0.018 124);
  --av-surface-overlay: oklch(25% 0.026 124);
  --av-surface-float: oklch(28% 0.028 124);
  --av-sidebar-bg: oklch(27% 0.045 125);
  --av-sidebar-border: oklch(33% 0.045 125);
  --av-sidebar-text: oklch(95% 0.009 125);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.013 125);
  --av-sidebar-hover-bg: oklch(32% 0.047 125);
  --av-sidebar-active-bg: oklch(92% 0.035 105);
  --av-sidebar-active-text: oklch(21% 0.045 125);
  --av-sidebar-marker: oklch(92% 0.035 105);
  --av-sidebar-scroll-thumb: oklch(44% 0.041 125);
  --av-sidebar-sweep-from: oklch(100% 0 0 / .16);
  --av-sidebar-sweep-to: oklch(100% 0 0 / .03);
  --av-sidebar-cta-bg: oklch(92% 0.035 105);
  --av-sidebar-cta-text: oklch(21% 0.045 125);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.057 125);
  --av-chart-2: oklch(74% 0.104 80);
  --av-chart-3: oklch(66% 0.102 52);
  --av-chart-4: oklch(73% 0.061 219);
  --av-chart-5: oklch(66% 0.064 348);
  --av-chart-6: oklch(72% 0.048 150);
  --av-chart-7: oklch(66% 0.038 60);
  --av-chart-8: oklch(66% 0.028 240);
  --av-chart-9: oklch(78% 0.046 125);
  --av-chart-10: oklch(84% 0.083 80);
}

[data-av-preset="frost"],
[data-av-preset="sage"] {
  --av-primary-50: oklch(97% 0.004 128);
  --av-primary-100: oklch(94% 0.008 128);
  --av-primary-200: oklch(89% 0.015 128);
  --av-primary-300: oklch(85% 0.025 128);
  --av-primary-400: oklch(66% 0.048 126);
  --av-primary-500: oklch(52% 0.052 122);
  --av-primary-600: oklch(40% 0.054 124);
  --av-primary-700: oklch(33% 0.05 126);
  --av-primary-800: oklch(28% 0.045 126);
  --av-primary-900: oklch(24% 0.04 125);
  --av-primary-950: oklch(20% 0.035 125);
  --av-accent-500: oklch(76% 0.07 75);
  --av-neutral-0: oklch(100% 0 128);
  --av-neutral-50: oklch(97% 0.002 128);
  --av-neutral-100: oklch(94% 0.003 128);
  --av-neutral-200: oklch(89% 0.006 128);
  --av-neutral-300: oklch(82% 0.01 128);
  --av-neutral-350: oklch(77% 0.012 128);
  --av-neutral-400: oklch(72% 0.015 128);
  --av-neutral-500: oklch(63% 0.019 128);
  --av-neutral-600: oklch(50% 0.02 128);
  --av-neutral-700: oklch(47% 0.018 128);
  --av-neutral-750: oklch(43.5% 0.017 128);
  --av-neutral-800: oklch(40% 0.015 128);
  --av-neutral-850: oklch(36.5% 0.013 128);
  --av-neutral-900: oklch(33% 0.011 128);
  --av-neutral-925: oklch(28.5% 0.009 128);
  --av-neutral-950: oklch(24% 0.008 128);
  --av-shadow-color: 30% 0.03 128;
  --av-surface-base: oklch(94.5% 0.022 128);
  --av-surface-raised: oklch(98.5% 0.01 128);
  --av-surface-sunken: oklch(92% 0.027 128);
  --av-surface-overlay: oklch(98.5% 0.01 128);
  --av-sidebar-bg: var(--av-surface-sunken);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-title: var(--av-text-secondary);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(39% 0.054 124);
  --av-chart-2: oklch(62% 0.08 72);
  --av-chart-3: oklch(48% 0.059 239);
  --av-chart-4: oklch(48% 0.094 31);
  --av-chart-5: oklch(58% 0.044 184);
  --av-chart-6: oklch(50% 0.05 320);
  --av-chart-7: oklch(56% 0.07 100);
  --av-chart-8: oklch(48% 0.015 128);
  --av-chart-9: oklch(51% 0.043 124);
  --av-chart-10: oklch(74% 0.064 72);
  --av-tile-2: oklch(62% 0.08 72);
  --av-tile-3: oklch(48% 0.059 239);
  --av-tile-4: oklch(48% 0.094 31);
}
[data-av-preset="frost"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="frost"],
[data-av-preset="sage"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="sage"] {
  --av-surface-base: oklch(19% 0.016 128);
  --av-surface-raised: oklch(23.5% 0.019 128);
  --av-surface-sunken: oklch(16.5% 0.014 128);
  --av-surface-overlay: oklch(27% 0.021 128);
  --av-surface-float: oklch(30% 0.022 128);
  --av-sidebar-bg: var(--av-surface-raised);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-title: var(--av-text-muted);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.051 124);
  --av-chart-2: oklch(76% 0.076 72);
  --av-chart-3: oklch(66% 0.056 239);
  --av-chart-4: oklch(66% 0.089 31);
  --av-chart-5: oklch(72% 0.042 184);
  --av-chart-6: oklch(66% 0.048 320);
  --av-chart-7: oklch(70% 0.067 100);
  --av-chart-8: oklch(66% 0.014 128);
  --av-chart-9: oklch(78% 0.041 124);
  --av-chart-10: oklch(84% 0.061 72);
}

[data-av-preset="deepsea"] {
  --av-primary-50: oklch(97% 0.004 246);
  --av-primary-100: oklch(94% 0.007 246);
  --av-primary-200: oklch(89% 0.013 246);
  --av-primary-300: oklch(80% 0.03 240);
  --av-primary-400: oklch(68% 0.04 240);
  --av-primary-500: oklch(55% 0.04 243);
  --av-primary-600: oklch(46% 0.04 243);
  --av-primary-700: oklch(38% 0.045 245);
  --av-primary-800: oklch(31% 0.046 244);
  --av-primary-900: oklch(23% 0.04 250);
  --av-primary-950: oklch(19% 0.034 253);
  --av-accent-500: oklch(80% 0.085 222);
  --av-neutral-0: oklch(100% 0 250);
  --av-neutral-50: oklch(97% 0.001 250);
  --av-neutral-100: oklch(94% 0.002 250);
  --av-neutral-200: oklch(89% 0.004 250);
  --av-neutral-300: oklch(82% 0.006 250);
  --av-neutral-350: oklch(77% 0.007 250);
  --av-neutral-400: oklch(72% 0.009 250);
  --av-neutral-500: oklch(63% 0.011 250);
  --av-neutral-600: oklch(50% 0.012 250);
  --av-neutral-700: oklch(47% 0.011 250);
  --av-neutral-750: oklch(43.5% 0.01 250);
  --av-neutral-800: oklch(40% 0.009 250);
  --av-neutral-850: oklch(36.5% 0.008 250);
  --av-neutral-900: oklch(33% 0.007 250);
  --av-neutral-925: oklch(28.5% 0.006 250);
  --av-neutral-950: oklch(24% 0.005 250);
  --av-shadow-color: 20% 0.03 250;
  --av-surface-base: oklch(94% 0.004 250);
  --av-surface-raised: oklch(98% 0.002 250);
  --av-surface-sunken: oklch(91.5% 0.005 250);
  --av-surface-overlay: oklch(98% 0.002 250);
  --av-sidebar-bg: oklch(22% 0.05 250);
  --av-sidebar-border: oklch(29% 0.055 250);
  --av-sidebar-text: oklch(82% 0.025 250);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.03 250);
  --av-sidebar-hover-bg: oklch(27% 0.053 250);
  --av-sidebar-active-bg: oklch(32% 0.06 250);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: oklch(40% 0.05 250);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(30% 0.046 244);
  --av-chart-2: oklch(60% 0.09 222);
  --av-chart-3: oklch(52% 0.142 24);
  --av-chart-4: oklch(50% 0.083 181);
  --av-chart-5: oklch(62% 0.088 74);
  --av-chart-6: oklch(46% 0.08 290);
  --av-chart-7: oklch(50% 0.006 250);
  --av-chart-8: oklch(42% 0.03 245);
  --av-chart-9: oklch(42% 0.037 244);
  --av-chart-10: oklch(72% 0.072 222);
  --av-tile-2: oklch(60% 0.09 222);
  --av-tile-3: oklch(52% 0.142 24);
  --av-tile-4: oklch(50% 0.083 181);
}
[data-av-preset="deepsea"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="deepsea"] {
  --av-shadow-color: 3% 0.025 252;
  --av-surface-base: oklch(15.5% 0.03 252);
  --av-surface-raised: oklch(20% 0.036 252);
  --av-surface-sunken: oklch(13% 0.027 252);
  --av-surface-overlay: oklch(23.5% 0.04 252);
  --av-surface-float: oklch(26.5% 0.041 252);
  --av-sidebar-bg: oklch(11% 0.03 253);
  --av-sidebar-border: oklch(18% 0.033 253);
  --av-sidebar-text: oklch(82% 0.015 253);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.018 253);
  --av-sidebar-hover-bg: oklch(16% 0.032 253);
  --av-sidebar-active-bg: oklch(21% 0.036 253);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: oklch(80% 0.085 222);
  --av-sidebar-scroll-thumb: oklch(29% 0.03 253);
  --av-sidebar-sweep-from: color-mix(in oklab, oklch(80% 0.085 222) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, oklch(80% 0.085 222) 4%, transparent);
  --av-sidebar-cta-bg: oklch(80% 0.085 222);
  --av-sidebar-cta-text: oklch(20% 0.03 245);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-color-primary: oklch(80% 0.085 222);
  --av-color-primary-hover: oklch(85% 0.077 222);
  --av-color-primary-active: oklch(75% 0.085 222);
  --av-accent-500: oklch(70% 0.045 262);
  --av-metal: oklch(80% 0.085 222);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.044 244);
  --av-chart-2: oklch(74% 0.085 222);
  --av-chart-3: oklch(66% 0.135 24);
  --av-chart-4: oklch(66% 0.079 181);
  --av-chart-5: oklch(76% 0.084 74);
  --av-chart-6: oklch(66% 0.076 290);
  --av-chart-7: oklch(66% 0.006 250);
  --av-chart-8: oklch(66% 0.028 245);
  --av-chart-9: oklch(78% 0.035 244);
  --av-chart-10: oklch(84% 0.068 222);
}

[data-av-preset="urbanite"],
[data-av-preset="arctic"],
[data-av-preset="slate"],
[data-av-preset="nord"] {
  --av-primary-50: oklch(97% 0.001 195);
  --av-primary-100: oklch(94% 0.003 195);
  --av-primary-200: oklch(89% 0.005 195);
  --av-primary-300: oklch(77% 0.016 182);
  --av-primary-400: oklch(65% 0.019 188);
  --av-primary-500: oklch(55% 0.017 170);
  --av-primary-600: oklch(33% 0.016 209);
  --av-primary-700: oklch(27% 0.014 212);
  --av-primary-800: oklch(22% 0.012 215);
  --av-primary-900: oklch(21% 0.012 215);
  --av-primary-950: oklch(19% 0.011 217);
  --av-accent-500: oklch(62% 0.07 185);
  --av-neutral-0: oklch(100% 0 185);
  --av-neutral-50: oklch(97% 0.001 185);
  --av-neutral-100: oklch(94% 0.002 185);
  --av-neutral-200: oklch(89% 0.004 185);
  --av-neutral-300: oklch(82% 0.007 185);
  --av-neutral-350: oklch(77% 0.009 185);
  --av-neutral-400: oklch(72% 0.01 185);
  --av-neutral-500: oklch(63% 0.013 185);
  --av-neutral-600: oklch(50% 0.014 185);
  --av-neutral-700: oklch(47% 0.013 185);
  --av-neutral-750: oklch(43.5% 0.012 185);
  --av-neutral-800: oklch(40% 0.01 185);
  --av-neutral-850: oklch(36.5% 0.009 185);
  --av-neutral-900: oklch(33% 0.008 185);
  --av-neutral-925: oklch(28.5% 0.007 185);
  --av-neutral-950: oklch(24% 0.005 185);
  --av-shadow-color: 20% 0.012 200;
  --av-surface-base: oklch(96% 0.007 172);
  --av-surface-raised: oklch(99.4% 0.003 172);
  --av-surface-sunken: oklch(93.5% 0.009 172);
  --av-surface-overlay: oklch(99.4% 0.003 172);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(38% 0.02 200);
  --av-chart-2: oklch(61% 0.08 185);
  --av-chart-3: oklch(51% 0.101 60);
  --av-chart-4: oklch(46% 0.065 263);
  --av-chart-5: oklch(58% 0.057 110);
  --av-chart-6: oklch(50% 0.05 330);
  --av-chart-7: oklch(56% 0.04 230);
  --av-chart-8: oklch(30% 0.01 217);
  --av-chart-9: oklch(50% 0.016 200);
  --av-chart-10: oklch(73% 0.064 185);
  --av-tile-2: oklch(61% 0.08 185);
  --av-tile-3: oklch(51% 0.101 60);
  --av-tile-4: oklch(46% 0.065 263);
}
[data-av-preset="urbanite"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="urbanite"],
[data-av-preset="arctic"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="arctic"],
[data-av-preset="slate"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="slate"],
[data-av-preset="nord"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="nord"] {
  --av-surface-base: oklch(18.5% 0.01 217);
  --av-surface-raised: oklch(23% 0.012 217);
  --av-surface-sunken: oklch(16% 0.009 217);
  --av-surface-overlay: oklch(26.5% 0.013 217);
  --av-surface-float: oklch(29.5% 0.014 217);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-color-primary: oklch(74% 0.08 185);
  --av-color-primary-hover: oklch(79% 0.072 185);
  --av-color-primary-active: oklch(69% 0.08 185);
  --av-accent-500: oklch(78% 0.02 200);
  --av-metal: oklch(74% 0.08 185);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.019 200);
  --av-chart-2: oklch(75% 0.076 185);
  --av-chart-3: oklch(66% 0.096 60);
  --av-chart-4: oklch(66% 0.062 263);
  --av-chart-5: oklch(72% 0.054 110);
  --av-chart-6: oklch(66% 0.048 330);
  --av-chart-7: oklch(70% 0.038 230);
  --av-chart-8: oklch(66% 0.009 217);
  --av-chart-9: oklch(78% 0.015 200);
  --av-chart-10: oklch(84% 0.061 185);
}

[data-av-preset="jewel"] {
  --av-primary-50: oklch(97% 0.007 176);
  --av-primary-100: oklch(94% 0.014 176);
  --av-primary-200: oklch(89% 0.027 176);
  --av-primary-300: oklch(82% 0.045 176);
  --av-primary-400: oklch(70% 0.09 176);
  --av-primary-500: oklch(58% 0.095 176);
  --av-primary-600: oklch(48% 0.089 176);
  --av-primary-700: oklch(41% 0.08 176);
  --av-primary-800: oklch(35% 0.07 176);
  --av-primary-900: oklch(33% 0.05 176);
  --av-primary-950: oklch(24% 0.035 176);
  --av-accent-500: oklch(72% 0.135 82);
  --av-neutral-0: oklch(100% 0 265);
  --av-neutral-50: oklch(97% 0.001 265);
  --av-neutral-100: oklch(94% 0.002 265);
  --av-neutral-200: oklch(89% 0.004 265);
  --av-neutral-300: oklch(82% 0.006 265);
  --av-neutral-350: oklch(77% 0.007 265);
  --av-neutral-400: oklch(72% 0.009 265);
  --av-neutral-500: oklch(63% 0.011 265);
  --av-neutral-600: oklch(50% 0.012 265);
  --av-neutral-700: oklch(47% 0.011 265);
  --av-neutral-750: oklch(43.5% 0.01 265);
  --av-neutral-800: oklch(40% 0.009 265);
  --av-neutral-850: oklch(36.5% 0.008 265);
  --av-neutral-900: oklch(33% 0.007 265);
  --av-neutral-925: oklch(28.5% 0.006 265);
  --av-neutral-950: oklch(24% 0.005 265);
  --av-shadow-color: 16% 0.02 265;
  --av-surface-base: oklch(96.5% 0.004 90);
  --av-surface-raised: oklch(99.4% 0.002 90);
  --av-surface-sunken: oklch(94% 0.005 90);
  --av-surface-overlay: oklch(99.4% 0.002 90);
  --av-sidebar-bg: oklch(14% 0.006 265);
  --av-sidebar-border: oklch(21% 0.007 265);
  --av-sidebar-text: oklch(82% 0.003 265);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.004 265);
  --av-sidebar-hover-bg: oklch(19% 0.006 265);
  --av-sidebar-active-bg: oklch(24% 0.007 265);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: oklch(32% 0.006 265);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(48% 0.089 176);
  --av-chart-2: oklch(60% 0.125 82);
  --av-chart-3: oklch(32% 0.1 265);
  --av-chart-4: oklch(42% 0.15 19);
  --av-chart-5: oklch(45% 0.12 310);
  --av-chart-6: oklch(58% 0.08 200);
  --av-chart-7: oklch(52% 0.13 40);
  --av-chart-8: oklch(40% 0.005 265);
  --av-chart-9: oklch(60% 0.071 176);
  --av-chart-10: oklch(72% 0.1 82);
  --av-tile-2: oklch(60% 0.125 82);
  --av-tile-3: oklch(32% 0.1 265);
  --av-tile-4: oklch(42% 0.15 19);
}
[data-av-preset="jewel"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="jewel"] {
  --av-shadow-color: 2% 0.005 265;
  --av-surface-base: oklch(14.5% 0.004 265);
  --av-surface-raised: oklch(19% 0.006 265);
  --av-surface-sunken: oklch(12% 0.004 265);
  --av-surface-overlay: oklch(22.5% 0.007 265);
  --av-surface-float: oklch(25.5% 0.007 265);
  --av-sidebar-bg: oklch(10% 0.006 265);
  --av-sidebar-border: oklch(17% 0.007 265);
  --av-sidebar-text: oklch(82% 0.003 265);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.004 265);
  --av-sidebar-hover-bg: oklch(15% 0.006 265);
  --av-sidebar-active-bg: oklch(20% 0.007 265);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: oklch(28% 0.006 265);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.085 176);
  --av-chart-2: oklch(74% 0.119 82);
  --av-chart-3: oklch(66% 0.095 265);
  --av-chart-4: oklch(66% 0.142 19);
  --av-chart-5: oklch(66% 0.114 310);
  --av-chart-6: oklch(72% 0.076 200);
  --av-chart-7: oklch(66% 0.123 40);
  --av-chart-8: oklch(66% 0.005 265);
  --av-chart-9: oklch(78% 0.068 176);
  --av-chart-10: oklch(84% 0.095 82);
}

[data-av-preset="heritage"],
[data-av-preset="paper"],
[data-av-preset="sand"],
[data-av-preset="midnight"] {
  --av-primary-50: oklch(97% 0.007 15);
  --av-primary-100: oklch(94% 0.014 15);
  --av-primary-200: oklch(89% 0.027 15);
  --av-primary-300: oklch(82% 0.045 15);
  --av-primary-400: oklch(68% 0.08 15);
  --av-primary-500: oklch(52% 0.095 15);
  --av-primary-600: oklch(38% 0.09 15);
  --av-primary-700: oklch(30% 0.068 15);
  --av-primary-800: oklch(25% 0.06 15);
  --av-primary-900: oklch(21% 0.05 15);
  --av-primary-950: oklch(18% 0.04 15);
  --av-accent-500: oklch(62% 0.1 63);
  --av-neutral-0: oklch(100% 0 75);
  --av-neutral-50: oklch(97% 0.002 75);
  --av-neutral-100: oklch(94% 0.005 75);
  --av-neutral-200: oklch(89% 0.009 75);
  --av-neutral-300: oklch(82% 0.015 75);
  --av-neutral-350: oklch(77% 0.019 75);
  --av-neutral-400: oklch(72% 0.022 75);
  --av-neutral-500: oklch(63% 0.028 75);
  --av-neutral-600: oklch(50% 0.03 75);
  --av-neutral-700: oklch(47% 0.027 75);
  --av-neutral-750: oklch(43.5% 0.025 75);
  --av-neutral-800: oklch(40% 0.022 75);
  --av-neutral-850: oklch(36.5% 0.019 75);
  --av-neutral-900: oklch(33% 0.017 75);
  --av-neutral-925: oklch(28.5% 0.014 75);
  --av-neutral-950: oklch(24% 0.012 75);
  --av-shadow-color: 22% 0.03 60;
  --av-surface-base: oklch(93.5% 0.016 81);
  --av-surface-raised: oklch(97.5% 0.007 81);
  --av-surface-sunken: oklch(91% 0.02 81);
  --av-surface-overlay: oklch(97.5% 0.007 81);
  --av-sidebar-bg: var(--av-surface-sunken);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-title: var(--av-text-secondary);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(38% 0.09 15);
  --av-chart-2: oklch(59% 0.06 114);
  --av-chart-3: oklch(29% 0.051 273);
  --av-chart-4: oklch(55% 0.123 61);
  --av-chart-5: oklch(48% 0.037 195);
  --av-chart-6: oklch(58% 0.09 90);
  --av-chart-7: oklch(42% 0.06 330);
  --av-chart-8: oklch(40% 0.006 80);
  --av-chart-9: oklch(50% 0.072 15);
  --av-chart-10: oklch(71% 0.048 114);
  --av-tile-2: oklch(59% 0.06 114);
  --av-tile-3: oklch(29% 0.051 273);
  --av-tile-4: oklch(55% 0.123 61);
}
[data-av-preset="heritage"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="heritage"],
[data-av-preset="paper"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="paper"],
[data-av-preset="sand"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="sand"],
[data-av-preset="midnight"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="midnight"] {
  --av-shadow-color: 3% 0.006 80;
  --av-surface-base: oklch(16.5% 0.004 80);
  --av-surface-raised: oklch(21% 0.006 80);
  --av-surface-sunken: oklch(14% 0.004 80);
  --av-surface-overlay: oklch(24.5% 0.007 80);
  --av-surface-float: oklch(27.5% 0.007 80);
  --av-sidebar-bg: var(--av-surface-raised);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-title: var(--av-text-muted);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.085 15);
  --av-chart-2: oklch(73% 0.057 114);
  --av-chart-3: oklch(66% 0.048 273);
  --av-chart-4: oklch(69% 0.117 61);
  --av-chart-5: oklch(66% 0.035 195);
  --av-chart-6: oklch(72% 0.085 90);
  --av-chart-7: oklch(66% 0.057 330);
  --av-chart-8: oklch(66% 0.006 80);
  --av-chart-9: oklch(78% 0.068 15);
  --av-chart-10: oklch(84% 0.046 114);
}

[data-av-preset="kuri"],
[data-av-preset="terracotta"],
[data-av-preset="ember"],
[data-av-preset="crimson"],
[data-av-preset="forge"],
[data-av-preset="noir"] {
  --av-primary-50: oklch(97% 0.006 53);
  --av-primary-100: oklch(94% 0.012 53);
  --av-primary-200: oklch(89% 0.022 53);
  --av-primary-300: oklch(82% 0.037 53);
  --av-primary-400: oklch(73% 0.05 51);
  --av-primary-500: oklch(62% 0.07 53);
  --av-primary-600: oklch(48% 0.075 53);
  --av-primary-700: oklch(41% 0.06 55);
  --av-primary-800: oklch(35% 0.045 58);
  --av-primary-900: oklch(28% 0.03 60);
  --av-primary-950: oklch(22% 0.02 60);
  --av-accent-500: oklch(72% 0.07 215);
  --av-neutral-0: oklch(100% 0 55);
  --av-neutral-50: oklch(97% 0.002 55);
  --av-neutral-100: oklch(94% 0.003 55);
  --av-neutral-200: oklch(89% 0.006 55);
  --av-neutral-300: oklch(82% 0.01 55);
  --av-neutral-350: oklch(77% 0.012 55);
  --av-neutral-400: oklch(72% 0.015 55);
  --av-neutral-500: oklch(63% 0.019 55);
  --av-neutral-600: oklch(50% 0.02 55);
  --av-neutral-700: oklch(47% 0.018 55);
  --av-neutral-750: oklch(43.5% 0.017 55);
  --av-neutral-800: oklch(40% 0.015 55);
  --av-neutral-850: oklch(36.5% 0.013 55);
  --av-neutral-900: oklch(33% 0.011 55);
  --av-neutral-925: oklch(28.5% 0.009 55);
  --av-neutral-950: oklch(24% 0.008 55);
  --av-shadow-color: 28% 0.05 50;
  --av-surface-base: oklch(94.5% 0.016 52);
  --av-surface-raised: oklch(98.5% 0.007 52);
  --av-surface-sunken: oklch(92% 0.02 52);
  --av-surface-overlay: oklch(98.5% 0.007 52);
  --av-sidebar-bg: oklch(34% 0.03 58);
  --av-sidebar-border: oklch(40% 0.03 58);
  --av-sidebar-text: oklch(95% 0.006 58);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.009 58);
  --av-sidebar-hover-bg: oklch(39% 0.032 58);
  --av-sidebar-active-bg: oklch(95% 0.015 52);
  --av-sidebar-active-text: oklch(28% 0.03 58);
  --av-sidebar-marker: oklch(95% 0.015 52);
  --av-sidebar-scroll-thumb: oklch(51% 0.027 58);
  --av-sidebar-sweep-from: oklch(100% 0 0 / .16);
  --av-sidebar-sweep-to: oklch(100% 0 0 / .03);
  --av-sidebar-cta-bg: oklch(95% 0.015 52);
  --av-sidebar-cta-text: oklch(28% 0.03 58);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(47% 0.075 53);
  --av-chart-2: oklch(34% 0.04 220);
  --av-chart-3: oklch(56% 0.115 82);
  --av-chart-4: oklch(40% 0.074 341);
  --av-chart-5: oklch(57% 0.053 139);
  --av-chart-6: oklch(50% 0.12 35);
  --av-chart-7: oklch(50% 0.03 250);
  --av-chart-8: oklch(32% 0.02 58);
  --av-chart-9: oklch(59% 0.06 53);
  --av-chart-10: oklch(46% 0.032 220);
  --av-tile-2: oklch(34% 0.04 220);
  --av-tile-3: oklch(56% 0.115 82);
  --av-tile-4: oklch(40% 0.074 341);
}
[data-av-preset="kuri"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="kuri"],
[data-av-preset="terracotta"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="terracotta"],
[data-av-preset="ember"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="ember"],
[data-av-preset="crimson"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="crimson"],
[data-av-preset="forge"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="forge"],
[data-av-preset="noir"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="noir"] {
  --av-shadow-color: 5% 0.02 50;
  --av-surface-base: oklch(17.5% 0.012 60);
  --av-surface-raised: oklch(22% 0.014 60);
  --av-surface-sunken: oklch(15% 0.011 60);
  --av-surface-overlay: oklch(25.5% 0.016 60);
  --av-surface-float: oklch(28.5% 0.017 60);
  --av-sidebar-bg: oklch(26% 0.026 58);
  --av-sidebar-border: oklch(32% 0.026 58);
  --av-sidebar-text: oklch(95% 0.005 58);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.008 58);
  --av-sidebar-hover-bg: oklch(31% 0.027 58);
  --av-sidebar-active-bg: oklch(93% 0.015 52);
  --av-sidebar-active-text: oklch(20% 0.026 58);
  --av-sidebar-marker: oklch(93% 0.015 52);
  --av-sidebar-scroll-thumb: oklch(43% 0.023 58);
  --av-sidebar-sweep-from: oklch(100% 0 0 / .16);
  --av-sidebar-sweep-to: oklch(100% 0 0 / .03);
  --av-sidebar-cta-bg: oklch(93% 0.015 52);
  --av-sidebar-cta-text: oklch(20% 0.026 58);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.071 53);
  --av-chart-2: oklch(66% 0.038 220);
  --av-chart-3: oklch(70% 0.109 82);
  --av-chart-4: oklch(66% 0.07 341);
  --av-chart-5: oklch(71% 0.05 139);
  --av-chart-6: oklch(66% 0.114 35);
  --av-chart-7: oklch(66% 0.028 250);
  --av-chart-8: oklch(66% 0.019 58);
  --av-chart-9: oklch(78% 0.057 53);
  --av-chart-10: oklch(78% 0.03 220);
}

[data-av-preset="catawba"] {
  --av-primary-50: oklch(97% 0.003 247);
  --av-primary-100: oklch(94% 0.006 247);
  --av-primary-200: oklch(89% 0.012 247);
  --av-primary-300: oklch(82% 0.02 247);
  --av-primary-400: oklch(70% 0.035 245);
  --av-primary-500: oklch(56% 0.04 246);
  --av-primary-600: oklch(34% 0.04 247);
  --av-primary-700: oklch(28% 0.031 247);
  --av-primary-800: oklch(24% 0.03 247);
  --av-primary-900: oklch(21% 0.028 247);
  --av-primary-950: oklch(18% 0.026 247);
  --av-accent-500: oklch(68% 0.12 22);
  --av-neutral-0: oklch(100% 0 230);
  --av-neutral-50: oklch(97% 0.001 230);
  --av-neutral-100: oklch(94% 0.002 230);
  --av-neutral-200: oklch(89% 0.004 230);
  --av-neutral-300: oklch(82% 0.007 230);
  --av-neutral-350: oklch(77% 0.009 230);
  --av-neutral-400: oklch(72% 0.01 230);
  --av-neutral-500: oklch(63% 0.013 230);
  --av-neutral-600: oklch(50% 0.014 230);
  --av-neutral-700: oklch(47% 0.013 230);
  --av-neutral-750: oklch(43.5% 0.012 230);
  --av-neutral-800: oklch(40% 0.01 230);
  --av-neutral-850: oklch(36.5% 0.009 230);
  --av-neutral-900: oklch(33% 0.008 230);
  --av-neutral-925: oklch(28.5% 0.007 230);
  --av-neutral-950: oklch(24% 0.005 230);
  --av-shadow-color: 22% 0.04 5;
  --av-surface-base: oklch(94.5% 0.011 73);
  --av-surface-raised: oklch(98.5% 0.005 73);
  --av-surface-sunken: oklch(92% 0.014 73);
  --av-surface-overlay: oklch(98.5% 0.005 73);
  --av-sidebar-bg: oklch(36% 0.08 9);
  --av-sidebar-border: oklch(42% 0.08 9);
  --av-sidebar-text: oklch(95% 0.016 9);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.024 9);
  --av-sidebar-hover-bg: oklch(41% 0.084 9);
  --av-sidebar-active-bg: oklch(30% 0.07 9);
  --av-sidebar-active-text: oklch(100% 0 0);
  --av-sidebar-marker: oklch(74% 0.12 22);
  --av-sidebar-scroll-thumb: oklch(53% 0.072 9);
  --av-sidebar-sweep-from: oklch(74% 0.12 22 / .32);
  --av-sidebar-sweep-to: oklch(74% 0.12 22 / .04);
  --av-sidebar-cta-bg: oklch(74% 0.12 22);
  --av-sidebar-cta-text: oklch(22% 0.05 9);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(32% 0.04 247);
  --av-chart-2: oklch(52% 0.125 22);
  --av-chart-3: oklch(62% 0.036 195);
  --av-chart-4: oklch(39% 0.076 11);
  --av-chart-5: oklch(56% 0.085 89);
  --av-chart-6: oklch(52% 0.06 255);
  --av-chart-7: oklch(45% 0.07 320);
  --av-chart-8: oklch(50% 0.05 180);
  --av-chart-9: oklch(44% 0.032 247);
  --av-chart-10: oklch(64% 0.1 22);
  --av-tile-2: oklch(52% 0.125 22);
  --av-tile-3: oklch(62% 0.036 195);
  --av-tile-4: oklch(39% 0.076 11);
}
[data-av-preset="catawba"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="catawba"] {
  --av-shadow-color: 4% 0.02 247;
  --av-surface-base: oklch(17.5% 0.026 247);
  --av-surface-raised: oklch(22% 0.031 247);
  --av-surface-sunken: oklch(15% 0.023 247);
  --av-surface-overlay: oklch(25.5% 0.034 247);
  --av-surface-float: oklch(28.5% 0.036 247);
  --av-sidebar-bg: oklch(28% 0.07 9);
  --av-sidebar-border: oklch(34% 0.07 9);
  --av-sidebar-text: oklch(95% 0.014 9);
  --av-sidebar-text-strong: oklch(100% 0 0);
  --av-sidebar-title: oklch(90% 0.021 9);
  --av-sidebar-hover-bg: oklch(33% 0.074 9);
  --av-sidebar-active-bg: oklch(22% 0.06 9);
  --av-sidebar-active-text: oklch(100% 0 0);
  --av-sidebar-marker: oklch(74% 0.12 22);
  --av-sidebar-scroll-thumb: oklch(45% 0.063 9);
  --av-sidebar-sweep-from: oklch(74% 0.12 22 / .32);
  --av-sidebar-sweep-to: oklch(74% 0.12 22 / .04);
  --av-sidebar-cta-bg: oklch(74% 0.12 22);
  --av-sidebar-cta-text: oklch(22% 0.05 9);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-color-primary: oklch(84% 0.025 73);
  --av-color-primary-hover: oklch(89% 0.023 73);
  --av-color-primary-active: oklch(79% 0.025 73);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.038 247);
  --av-chart-2: oklch(66% 0.119 22);
  --av-chart-3: oklch(76% 0.034 195);
  --av-chart-4: oklch(66% 0.072 11);
  --av-chart-5: oklch(70% 0.081 89);
  --av-chart-6: oklch(66% 0.057 255);
  --av-chart-7: oklch(66% 0.067 320);
  --av-chart-8: oklch(66% 0.048 180);
  --av-chart-9: oklch(78% 0.03 247);
  --av-chart-10: oklch(78% 0.095 22);
}

[data-av-preset="granite"],
[data-av-preset="graphite"],
[data-av-preset="mono"],
[data-av-preset="github"],
[data-av-preset="carbon"] {
  --av-primary-50: oklch(97% 0.001 223);
  --av-primary-100: oklch(94% 0.002 223);
  --av-primary-200: oklch(89% 0.004 223);
  --av-primary-300: oklch(85% 0.018 188);
  --av-primary-400: oklch(78% 0.02 200);
  --av-primary-500: oklch(62% 0.028 215);
  --av-primary-600: oklch(23% 0.013 223);
  --av-primary-700: oklch(19% 0.012 223);
  --av-primary-800: oklch(16% 0.012 223);
  --av-primary-900: oklch(27% 0.014 223);
  --av-primary-950: oklch(22% 0.012 223);
  --av-accent-500: oklch(68% 0.06 215);
  --av-neutral-0: oklch(100% 0 200);
  --av-neutral-50: oklch(97% 0 200);
  --av-neutral-100: oklch(94% 0.001 200);
  --av-neutral-200: oklch(89% 0.002 200);
  --av-neutral-300: oklch(82% 0.003 200);
  --av-neutral-350: oklch(77% 0.004 200);
  --av-neutral-400: oklch(72% 0.004 200);
  --av-neutral-500: oklch(63% 0.006 200);
  --av-neutral-600: oklch(50% 0.006 200);
  --av-neutral-700: oklch(47% 0.005 200);
  --av-neutral-750: oklch(43.5% 0.005 200);
  --av-neutral-800: oklch(40% 0.004 200);
  --av-neutral-850: oklch(36.5% 0.004 200);
  --av-neutral-900: oklch(33% 0.003 200);
  --av-neutral-925: oklch(28.5% 0.003 200);
  --av-neutral-950: oklch(24% 0.002 200);
  --av-shadow-color: 16% 0.01 223;
  --av-surface-base: oklch(90% 0.008 188);
  --av-surface-raised: oklch(94% 0.004 188);
  --av-surface-sunken: oklch(87.5% 0.01 188);
  --av-surface-overlay: oklch(94% 0.004 188);
  --av-sidebar-bg: oklch(21% 0.013 223);
  --av-sidebar-border: oklch(28% 0.014 223);
  --av-sidebar-text: oklch(82% 0.006 223);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.008 223);
  --av-sidebar-hover-bg: oklch(26% 0.014 223);
  --av-sidebar-active-bg: oklch(31% 0.016 223);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-neutral-0);
  --av-sidebar-scroll-thumb: oklch(39% 0.013 223);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-neutral-0);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(26% 0.014 223);
  --av-chart-2: oklch(58% 0.07 235);
  --av-chart-3: oklch(45% 0.113 42);
  --av-chart-4: oklch(60% 0.066 128);
  --av-chart-5: oklch(48% 0.044 292);
  --av-chart-6: oklch(58% 0.06 85);
  --av-chart-7: oklch(50% 0.06 190);
  --av-chart-8: oklch(50% 0.006 200);
  --av-chart-9: oklch(38% 0.011 223);
  --av-chart-10: oklch(70% 0.056 235);
  --av-tile-2: oklch(58% 0.07 235);
  --av-tile-3: oklch(45% 0.113 42);
  --av-tile-4: oklch(60% 0.066 128);
}
[data-av-preset="granite"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="granite"],
[data-av-preset="graphite"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="graphite"],
[data-av-preset="mono"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="mono"],
[data-av-preset="github"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="github"],
[data-av-preset="carbon"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="carbon"] {
  --av-shadow-color: 2% 0.008 223;
  --av-surface-base: oklch(16.5% 0.01 223);
  --av-surface-raised: oklch(21% 0.012 223);
  --av-surface-sunken: oklch(14% 0.009 223);
  --av-surface-overlay: oklch(24.5% 0.013 223);
  --av-surface-float: oklch(27.5% 0.014 223);
  --av-sidebar-bg: oklch(12% 0.011 223);
  --av-sidebar-border: oklch(19% 0.012 223);
  --av-sidebar-text: oklch(82% 0.005 223);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.007 223);
  --av-sidebar-hover-bg: oklch(17% 0.012 223);
  --av-sidebar-active-bg: oklch(22% 0.013 223);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-neutral-0);
  --av-sidebar-scroll-thumb: oklch(30% 0.011 223);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-neutral-0);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.013 223);
  --av-chart-2: oklch(72% 0.067 235);
  --av-chart-3: oklch(66% 0.107 42);
  --av-chart-4: oklch(74% 0.063 128);
  --av-chart-5: oklch(66% 0.042 292);
  --av-chart-6: oklch(72% 0.057 85);
  --av-chart-7: oklch(66% 0.057 190);
  --av-chart-8: oklch(66% 0.006 200);
  --av-chart-9: oklch(78% 0.01 223);
  --av-chart-10: oklch(84% 0.054 235);
}

[data-av-preset="storm"] {
  --av-primary-50: oklch(97% 0.003 249);
  --av-primary-100: oklch(94% 0.006 249);
  --av-primary-200: oklch(89% 0.011 249);
  --av-primary-300: oklch(80% 0.03 249);
  --av-primary-400: oklch(68% 0.035 249);
  --av-primary-500: oklch(55% 0.04 249);
  --av-primary-600: oklch(34% 0.038 249);
  --av-primary-700: oklch(28% 0.034 249);
  --av-primary-800: oklch(24% 0.03 250);
  --av-primary-900: oklch(21% 0.02 255);
  --av-primary-950: oklch(18% 0.015 258);
  --av-accent-500: oklch(72% 0.115 78);
  --av-neutral-0: oklch(100% 0 135);
  --av-neutral-50: oklch(97% 0.001 135);
  --av-neutral-100: oklch(94% 0.002 135);
  --av-neutral-200: oklch(89% 0.004 135);
  --av-neutral-300: oklch(82% 0.007 135);
  --av-neutral-350: oklch(77% 0.009 135);
  --av-neutral-400: oklch(72% 0.011 135);
  --av-neutral-500: oklch(63% 0.014 135);
  --av-neutral-600: oklch(50% 0.015 135);
  --av-neutral-700: oklch(47% 0.014 135);
  --av-neutral-750: oklch(43.5% 0.012 135);
  --av-neutral-800: oklch(40% 0.011 135);
  --av-neutral-850: oklch(36.5% 0.01 135);
  --av-neutral-900: oklch(33% 0.008 135);
  --av-neutral-925: oklch(28.5% 0.007 135);
  --av-neutral-950: oklch(24% 0.006 135);
  --av-shadow-color: 24% 0.04 60;
  --av-surface-base: oklch(93% 0.017 68);
  --av-surface-raised: oklch(97% 0.008 68);
  --av-surface-sunken: oklch(90.5% 0.021 68);
  --av-surface-overlay: oklch(97% 0.008 68);
  --av-sidebar-bg: oklch(26% 0.034 249);
  --av-sidebar-border: oklch(33% 0.037 249);
  --av-sidebar-text: oklch(82% 0.017 249);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.02 249);
  --av-sidebar-hover-bg: oklch(31% 0.036 249);
  --av-sidebar-active-bg: oklch(36% 0.041 249);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: oklch(44% 0.034 249);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: var(--av-neutral-950);
  --av-text-on-primary: var(--av-neutral-0);
  --av-chart-1: oklch(30% 0.036 249);
  --av-chart-2: oklch(57% 0.115 78);
  --av-chart-3: oklch(60% 0.038 130);
  --av-chart-4: oklch(40% 0.102 24);
  --av-chart-5: oklch(47% 0.049 206);
  --av-chart-6: oklch(56% 0.03 60);
  --av-chart-7: oklch(44% 0.05 245);
  --av-chart-8: oklch(30% 0.01 261);
  --av-chart-9: oklch(42% 0.029 249);
  --av-chart-10: oklch(69% 0.092 78);
  --av-tile-2: oklch(57% 0.115 78);
  --av-tile-3: oklch(60% 0.038 130);
  --av-tile-4: oklch(40% 0.102 24);
}
[data-av-preset="storm"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-preset="storm"] {
  --av-shadow-color: 3% 0.01 261;
  --av-surface-base: oklch(16.5% 0.011 261);
  --av-surface-raised: oklch(21% 0.03 250);
  --av-surface-sunken: oklch(14% 0.01 261);
  --av-surface-overlay: oklch(24.5% 0.033 250);
  --av-surface-float: oklch(27.5% 0.034 250);
  --av-sidebar-bg: oklch(20% 0.03 249);
  --av-sidebar-border: oklch(27% 0.033 249);
  --av-sidebar-text: oklch(82% 0.015 249);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: oklch(74% 0.018 249);
  --av-sidebar-hover-bg: oklch(25% 0.032 249);
  --av-sidebar-active-bg: oklch(30% 0.036 249);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: oklch(72% 0.115 78);
  --av-sidebar-scroll-thumb: oklch(38% 0.03 249);
  --av-sidebar-sweep-from: color-mix(in oklab, oklch(72% 0.115 78) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, oklch(72% 0.115 78) 4%, transparent);
  --av-sidebar-cta-bg: oklch(72% 0.115 78);
  --av-sidebar-cta-text: oklch(20% 0.03 78);
  --av-color-primary: var(--av-primary-400);
  --av-color-primary-hover: var(--av-primary-300);
  --av-color-primary-active: var(--av-primary-200);
  --av-text-link: var(--av-primary-400);
  --av-color-primary: oklch(76% 0.115 80);
  --av-color-primary-hover: oklch(81% 0.104 80);
  --av-color-primary-active: oklch(71% 0.115 80);
  --av-accent-500: oklch(80% 0.035 249);
  --av-metal: oklch(76% 0.115 80);
  --av-text-on-primary: var(--av-neutral-950);
  --av-chart-1: oklch(66% 0.034 249);
  --av-chart-2: oklch(71% 0.109 78);
  --av-chart-3: oklch(74% 0.036 130);
  --av-chart-4: oklch(66% 0.097 24);
  --av-chart-5: oklch(66% 0.047 206);
  --av-chart-6: oklch(70% 0.028 60);
  --av-chart-7: oklch(66% 0.048 245);
  --av-chart-8: oklch(66% 0.009 261);
  --av-chart-9: oklch(78% 0.027 249);
  --av-chart-10: oklch(83% 0.087 78);
}

/* style: clean */
:root[data-av-style="clean"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="aurora"], [data-av-preset="material"]),
:root:where(:not([data-av-style]), [data-av-style="auto"]):not([data-av-preset]) {
  --av-radius-scale: 0.75;
  --av-shadow-xs: 0 0 0 1px oklch(var(--av-shadow-color) / 0.05);
  --av-shadow-sm: 0 0 0 1px oklch(var(--av-shadow-color) / 0.06), 0 1px 2px oklch(var(--av-shadow-color) / 0.04);
  --av-shadow-md: 0 0 0 1px oklch(var(--av-shadow-color) / 0.07), 0 4px 12px -4px oklch(var(--av-shadow-color) / 0.1);
  --av-shadow-lg: 0 0 0 1px oklch(var(--av-shadow-color) / 0.08), 0 12px 28px -10px oklch(var(--av-shadow-color) / 0.16);
  --av-shadow-xl: 0 0 0 1px oklch(var(--av-shadow-color) / 0.09), 0 22px 44px -14px oklch(var(--av-shadow-color) / 0.2);
  --av-kpi-fill: 6%;
  --av-kpi-edge: 18%;
  --av-kpi-chip: 15%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 3;
  --av-chart-dash: 0;
  --av-chart-stroke: 2;
  --av-chart-area: 0.18;
  --av-chart-curve: smooth;
}

/* style: editorial */
:root[data-av-style="editorial"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="heritage"], [data-av-preset="paper"], [data-av-preset="sand"], [data-av-preset="midnight"]) {
  --av-radius-scale: 0.3;
  --av-font-display: 'FrauncesVariable', var(--av-font-serif);
  --av-shadow-xs: none;
  --av-shadow-sm: none;
  --av-shadow-md: 0 1px 2px oklch(var(--av-shadow-color) / 0.06);
  --av-shadow-lg: 0 10px 30px -12px oklch(var(--av-shadow-color) / 0.18);
  --av-shadow-xl: 0 20px 50px -16px oklch(var(--av-shadow-color) / 0.22);
  --av-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --av-mesh-a: none;
  --av-mesh-b: none;
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 0%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 2;
  --av-chart-dash: 3;
  --av-chart-stroke: 2;
  --av-chart-area: 0.22;
  --av-chart-curve: smooth;
}
:root[data-av-style="editorial"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="heritage"], [data-av-preset="paper"], [data-av-preset="sand"], [data-av-preset="midnight"])[data-bs-theme="dark"] {
  --av-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* style: soft */
:root[data-av-style="soft"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="frost"], [data-av-preset="sage"]) {
  --av-radius-scale: 1.8;
  --av-sidebar-bg: var(--av-surface-sunken);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-text: var(--av-text-secondary);
  --av-sidebar-text-strong: var(--av-text-primary);
  --av-sidebar-title: var(--av-text-secondary);
  --av-sidebar-hover-bg: color-mix(in oklab, var(--av-text-primary) 7%, transparent);
  --av-sidebar-active-bg: var(--av-surface-sunken);
  --av-sidebar-active-text: var(--av-color-primary-text);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-border-strong);
  --av-sidebar-sweep-from: transparent;
  --av-sidebar-sweep-to: transparent;
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
  --av-shadow-xs: -2px -2px 5px oklch(var(--av-highlight-color) / 0.8), 2px 2px 5px oklch(var(--av-shadow-color) / 0.1);
  --av-shadow-sm: -5px -5px 12px oklch(var(--av-highlight-color) / 0.9), 6px 6px 14px oklch(var(--av-shadow-color) / 0.12);
  --av-shadow-md: -7px -7px 16px oklch(var(--av-highlight-color) / 0.9), 8px 8px 20px oklch(var(--av-shadow-color) / 0.14);
  --av-shadow-lg: -9px -9px 22px oklch(var(--av-highlight-color) / 0.9), 12px 12px 30px oklch(var(--av-shadow-color) / 0.18);
  --av-shadow-xl: -12px -12px 28px oklch(var(--av-highlight-color) / 0.9), 16px 16px 40px oklch(var(--av-shadow-color) / 0.22);
  --av-shadow-inner: inset 3px 3px 7px oklch(var(--av-shadow-color) / 0.14), inset -3px -3px 7px oklch(var(--av-highlight-color) / 0.9);
  --av-mesh-a: none;
  --av-mesh-b: none;
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 0%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 8;
  --av-chart-dash: 0;
  --av-chart-stroke: 3;
  --av-chart-area: 0.28;
  --av-chart-curve: smooth;
}
:root[data-av-style="soft"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="frost"], [data-av-preset="sage"])[data-bs-theme="dark"] {
  --av-shadow-xs: -2px -2px 5px oklch(var(--av-highlight-color) / 0.03), 2px 2px 6px oklch(var(--av-shadow-color) / 0.5);
  --av-shadow-sm: -4px -4px 10px oklch(var(--av-highlight-color) / 0.035), 6px 6px 14px oklch(var(--av-shadow-color) / 0.55);
  --av-shadow-md: -6px -6px 14px oklch(var(--av-highlight-color) / 0.04), 8px 8px 20px oklch(var(--av-shadow-color) / 0.6);
  --av-shadow-lg: -8px -8px 20px oklch(var(--av-highlight-color) / 0.04), 12px 12px 30px oklch(var(--av-shadow-color) / 0.65);
  --av-shadow-xl: -10px -10px 26px oklch(var(--av-highlight-color) / 0.045), 16px 16px 40px oklch(var(--av-shadow-color) / 0.7);
  --av-shadow-inner: inset 3px 3px 7px oklch(var(--av-shadow-color) / 0.6), inset -3px -3px 7px oklch(var(--av-highlight-color) / 0.04);
}

/* style: tactile */
:root[data-av-style="tactile"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="pine"], [data-av-preset="tidewater"], [data-av-preset="ocean"], [data-av-preset="harbour"]) {
  --av-radius-scale: 1;
  --av-font-display: 'SpaceGroteskVariable', var(--av-font-sans);
  --av-shadow-xs: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.6), 0 1px 2px oklch(var(--av-shadow-color) / 0.14);
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.7), 0 1px 2px oklch(var(--av-shadow-color) / 0.14), 0 4px 10px -2px oklch(var(--av-shadow-color) / 0.14);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.7), 0 2px 4px -1px oklch(var(--av-shadow-color) / 0.16), 0 10px 22px -6px oklch(var(--av-shadow-color) / 0.2);
  --av-shadow-lg: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.7), 0 4px 8px -2px oklch(var(--av-shadow-color) / 0.18), 0 18px 36px -10px oklch(var(--av-shadow-color) / 0.26);
  --av-shadow-xl: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.75), 0 8px 14px -4px oklch(var(--av-shadow-color) / 0.2), 0 30px 56px -16px oklch(var(--av-shadow-color) / 0.32);
  --av-shadow-inner: inset 0 2px 4px oklch(var(--av-shadow-color) / 0.22), inset 0 -1px 0 oklch(var(--av-highlight-color) / 0.5);
  --av-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 0%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 9%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 24%;
  --av-kpi-chip: 18%;
  --av-kpi-glow: 0.3;
  --av-kpi-bar: 0px;
  --av-chart-radius: 1;
  --av-chart-dash: 2;
  --av-chart-stroke: 2;
  --av-chart-area: 0.2;
  --av-chart-curve: straight;
}
:root[data-av-style="tactile"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="pine"], [data-av-preset="tidewater"], [data-av-preset="ocean"], [data-av-preset="harbour"])[data-bs-theme="dark"] {
  --av-shadow-xs: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.06), 0 1px 2px oklch(var(--av-shadow-color) / 0.6);
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.07), 0 1px 2px oklch(var(--av-shadow-color) / 0.6), 0 4px 10px -2px oklch(var(--av-shadow-color) / 0.5);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.08), 0 2px 4px -1px oklch(var(--av-shadow-color) / 0.6), 0 10px 22px -6px oklch(var(--av-shadow-color) / 0.55);
  --av-shadow-lg: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.08), 0 4px 8px -2px oklch(var(--av-shadow-color) / 0.65), 0 18px 36px -10px oklch(var(--av-shadow-color) / 0.6);
  --av-shadow-inner: inset 0 2px 5px oklch(var(--av-shadow-color) / 0.7), inset 0 -1px 0 oklch(var(--av-highlight-color) / 0.06);
  --av-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 0%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 14%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
}

/* style: bold */
:root[data-av-style="bold"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="jewel"]) {
  --av-radius-scale: 1.25;
  --av-shadow-sm: 0 1px 2px oklch(var(--av-shadow-color) / 0.06), 0 4px 14px -4px oklch(var(--av-shadow-color) / 0.12);
  --av-shadow-md: 0 2px 6px -2px oklch(var(--av-shadow-color) / 0.1), 0 12px 28px -10px oklch(var(--av-shadow-color) / 0.2);
  --av-mesh-a: none;
  --av-mesh-b: none;
  --av-mesh-c: none;
  --av-kpi-fill: 6%;
  --av-kpi-edge: 18%;
  --av-kpi-chip: 15%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 6;
  --av-chart-dash: 0;
  --av-chart-stroke: 3;
  --av-chart-area: 0.45;
  --av-chart-curve: smooth;
}

/* style: glass */
:root[data-av-style="glass"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="oxford"], [data-av-preset="neon"], [data-av-preset="grape"]) {
  --av-radius-scale: 1.3;
  --av-glass-blur: 22px;
  --av-glass-bg: color-mix(in oklab, var(--av-surface-raised) 54%, transparent);
  --av-glass-border: oklch(var(--av-highlight-color) / 0.66);
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.7), 0 14px 30px -22px oklch(var(--av-shadow-color) / 0.3);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.7), 0 18px 40px -22px oklch(var(--av-shadow-color) / 0.34);
  --av-shadow-lg: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.75), 0 40px 90px -40px oklch(var(--av-shadow-color) / 0.4);
  --av-mesh-a: radial-gradient(ellipse 60% 55% at 0% 0%, color-mix(in oklab, var(--av-primary-300) 85%, transparent) 0%, transparent 68%);
  --av-mesh-b: radial-gradient(ellipse 55% 55% at 100% 30%, color-mix(in oklab, var(--av-accent-500) 55%, transparent) 0%, transparent 66%);
  --av-mesh-c: radial-gradient(ellipse 60% 55% at 40% 110%, color-mix(in oklab, var(--av-primary-400) 55%, transparent) 0%, transparent 70%);
  --av-sidebar-bg: color-mix(in oklab, var(--av-surface-raised) 34%, transparent);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-text: var(--av-text-secondary);
  --av-sidebar-text-strong: var(--av-text-primary);
  --av-sidebar-title: var(--av-text-secondary);
  --av-sidebar-hover-bg: color-mix(in oklab, var(--av-text-primary) 7%, transparent);
  --av-sidebar-active-bg: var(--av-color-primary);
  --av-sidebar-active-text: var(--av-text-on-primary);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-border-strong);
  --av-sidebar-sweep-from: transparent;
  --av-sidebar-sweep-to: transparent;
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 16%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 6;
  --av-chart-dash: 0;
  --av-chart-stroke: 2.5;
  --av-chart-area: 0.35;
  --av-chart-curve: smooth;
}
:root[data-av-style="glass"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="oxford"], [data-av-preset="neon"], [data-av-preset="grape"])[data-bs-theme="dark"] {
  --av-glass-bg: color-mix(in oklab, var(--av-surface-raised) 50%, transparent);
  --av-glass-border: oklch(var(--av-highlight-color) / 0.1);
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.08), 0 14px 30px -22px oklch(var(--av-shadow-color) / 0.7);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.08), 0 18px 40px -22px oklch(var(--av-shadow-color) / 0.75);
  --av-shadow-lg: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.1), 0 40px 90px -40px oklch(var(--av-shadow-color) / 0.8);
  --av-mesh-a: radial-gradient(ellipse 60% 55% at 0% 0%, color-mix(in oklab, var(--av-chart-1) 46%, transparent) 0%, transparent 68%);
  --av-mesh-b: radial-gradient(ellipse 55% 55% at 100% 30%, color-mix(in oklab, var(--av-color-primary) 30%, transparent) 0%, transparent 66%);
  --av-mesh-c: radial-gradient(ellipse 60% 55% at 40% 110%, color-mix(in oklab, var(--av-chart-5) 34%, transparent) 0%, transparent 70%);
}

/* style: bento */
:root[data-av-style="bento"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="kuri"], [data-av-preset="terracotta"], [data-av-preset="ember"], [data-av-preset="crimson"], [data-av-preset="forge"], [data-av-preset="noir"]) {
  --av-radius-scale: 2;
  --av-shadow-xs: none;
  --av-shadow-sm: 0 1px 2px oklch(var(--av-shadow-color) / 0.05);
  --av-shadow-md: 0 2px 6px -2px oklch(var(--av-shadow-color) / 0.08), 0 14px 30px -18px oklch(var(--av-shadow-color) / 0.18);
  --av-shadow-lg: 0 4px 10px -4px oklch(var(--av-shadow-color) / 0.1), 0 26px 52px -22px oklch(var(--av-shadow-color) / 0.24);
  --av-shadow-xl: 0 8px 16px -6px oklch(var(--av-shadow-color) / 0.12), 0 38px 72px -26px oklch(var(--av-shadow-color) / 0.3);
  --av-mesh-a: none;
  --av-mesh-b: none;
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 100%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 10;
  --av-chart-dash: 0;
  --av-chart-stroke: 3;
  --av-chart-area: 0.3;
  --av-chart-curve: smooth;
}
:root[data-av-style="bento"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="kuri"], [data-av-preset="terracotta"], [data-av-preset="ember"], [data-av-preset="crimson"], [data-av-preset="forge"], [data-av-preset="noir"])[data-bs-theme="dark"] {
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.04), 0 1px 2px oklch(var(--av-shadow-color) / 0.5);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.05), 0 14px 30px -18px oklch(var(--av-shadow-color) / 0.6);
}

/* style: brutal */
:root[data-av-style="brutal"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="granite"], [data-av-preset="graphite"], [data-av-preset="mono"], [data-av-preset="github"], [data-av-preset="carbon"]) {
  --av-radius-scale: 0;
  --av-font-display: 'SpaceGroteskVariable', var(--av-font-sans);
  --av-shadow-xs: 2px 2px 0 var(--av-text-primary);
  --av-shadow-sm: 4px 4px 0 var(--av-text-primary);
  --av-shadow-md: 6px 6px 0 var(--av-text-primary);
  --av-shadow-lg: 8px 8px 0 var(--av-text-primary);
  --av-shadow-xl: 10px 10px 0 var(--av-text-primary);
  --av-mesh-a: none;
  --av-mesh-b: none;
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 100%;
  --av-kpi-chip: 0%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 0;
  --av-chart-dash: 0;
  --av-chart-stroke: 3;
  --av-chart-area: 0.15;
  --av-chart-curve: straight;
}

/* style: flat */
:root[data-av-style="flat"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="urbanite"], [data-av-preset="arctic"], [data-av-preset="slate"], [data-av-preset="nord"]) {
  --av-radius-scale: 0.9;
  --av-shadow-xs: none;
  --av-shadow-sm: none;
  --av-shadow-md: none;
  --av-shadow-lg: 0 12px 32px -12px oklch(var(--av-shadow-color) / 0.18);
  --av-shadow-xl: 0 24px 56px -20px oklch(var(--av-shadow-color) / 0.22);
  --av-mesh-a: none;
  --av-mesh-b: none;
  --av-mesh-c: none;
  --av-kpi-fill: 7%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 0%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 4;
  --av-chart-dash: 0;
  --av-chart-stroke: 2;
  --av-chart-area: 0.14;
  --av-chart-curve: smooth;
}

/* style: luxe */
:root[data-av-style="luxe"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="storm"]) {
  --av-radius-scale: 0.7;
  --av-font-display: 'FrauncesVariable', var(--av-font-serif);
  --av-shadow-sm: 0 1px 2px oklch(var(--av-shadow-color) / 0.05), 0 6px 18px -8px oklch(var(--av-shadow-color) / 0.14);
  --av-shadow-md: 0 2px 4px -1px oklch(var(--av-shadow-color) / 0.06), 0 14px 32px -12px oklch(var(--av-shadow-color) / 0.2);
  --av-shadow-lg: 0 4px 8px -2px oklch(var(--av-shadow-color) / 0.08), 0 22px 48px -16px oklch(var(--av-shadow-color) / 0.26);
  --av-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 7%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 9%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 14%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 4;
  --av-chart-dash: 3;
  --av-chart-stroke: 2.5;
  --av-chart-area: 0.3;
  --av-chart-curve: smooth;
}
:root[data-av-style="luxe"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="storm"])[data-bs-theme="dark"] {
  --av-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 26%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 12%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
}

/* style: organic */
:root[data-av-style="organic"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="matsuba"], [data-av-preset="evergreen"], [data-av-preset="forest"]) {
  --av-radius-scale: 1.5;
  --av-shadow-xs: 0 1px 2px oklch(var(--av-shadow-color) / 0.05);
  --av-shadow-sm: 0 1px 2px oklch(var(--av-shadow-color) / 0.05), 0 8px 20px -10px oklch(var(--av-shadow-color) / 0.14);
  --av-shadow-md: 0 2px 4px -1px oklch(var(--av-shadow-color) / 0.06), 0 16px 34px -14px oklch(var(--av-shadow-color) / 0.2);
  --av-shadow-lg: 0 4px 8px -2px oklch(var(--av-shadow-color) / 0.07), 0 26px 52px -18px oklch(var(--av-shadow-color) / 0.26);
  --av-shadow-xl: 0 8px 14px -4px oklch(var(--av-shadow-color) / 0.08), 0 38px 70px -22px oklch(var(--av-shadow-color) / 0.3);
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 10%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 12%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
  --av-kpi-fill: 9%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 20%;
  --av-kpi-glow: 0.22;
  --av-kpi-bar: 0px;
  --av-chart-radius: 8;
  --av-chart-dash: 0;
  --av-chart-stroke: 3;
  --av-chart-area: 0.36;
  --av-chart-curve: smooth;
}
:root[data-av-style="organic"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="matsuba"], [data-av-preset="evergreen"], [data-av-preset="forest"])[data-bs-theme="dark"] {
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.05), 0 8px 20px -10px oklch(var(--av-shadow-color) / 0.6);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.06), 0 16px 34px -14px oklch(var(--av-shadow-color) / 0.65);
  --av-shadow-lg: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.06), 0 26px 52px -18px oklch(var(--av-shadow-color) / 0.7);
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 22%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 8%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
}

/* style: blueprint */
:root[data-av-style="blueprint"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="deepsea"]) {
  --av-radius-scale: 0.25;
  --av-font-display: var(--av-font-mono);
  --av-shadow-xs: none;
  --av-shadow-sm: none;
  --av-shadow-md: none;
  --av-shadow-lg: 0 14px 34px -14px oklch(var(--av-shadow-color) / 0.22);
  --av-shadow-xl: 0 24px 56px -20px oklch(var(--av-shadow-color) / 0.28);
  --av-mesh-a: repeating-linear-gradient(0deg, color-mix(in oklab, var(--av-color-primary) 7%, transparent) 0 1px, transparent 1px 32px);
  --av-mesh-b: repeating-linear-gradient(90deg, color-mix(in oklab, var(--av-color-primary) 7%, transparent) 0 1px, transparent 1px 32px);
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 45%;
  --av-kpi-chip: 0%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 0px;
  --av-chart-radius: 0;
  --av-chart-dash: 4;
  --av-chart-stroke: 1.5;
  --av-chart-area: 0.08;
  --av-chart-curve: straight;
}
:root[data-av-style="blueprint"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="deepsea"])[data-bs-theme="dark"] {
  --av-mesh-a: repeating-linear-gradient(0deg, color-mix(in oklab, var(--av-color-primary) 16%, transparent) 0 1px, transparent 1px 32px);
  --av-mesh-b: repeating-linear-gradient(90deg, color-mix(in oklab, var(--av-color-primary) 16%, transparent) 0 1px, transparent 1px 32px);
  --av-shadow-lg: 0 14px 34px -14px oklch(var(--av-shadow-color) / 0.7);
  --av-shadow-xl: 0 24px 56px -20px oklch(var(--av-shadow-color) / 0.75);
}

/* style: duotone */
:root[data-av-style="duotone"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="catawba"]) {
  --av-radius-scale: 1.1;
  --av-shadow-xs: 0 1px 2px oklch(var(--av-shadow-color) / 0.05);
  --av-shadow-sm: 0 1px 2px oklch(var(--av-shadow-color) / 0.05), 0 10px 26px -14px color-mix(in oklab, var(--av-accent-500) 45%, transparent);
  --av-shadow-md: 0 2px 4px -1px oklch(var(--av-shadow-color) / 0.06), 0 18px 40px -16px color-mix(in oklab, var(--av-accent-500) 55%, transparent);
  --av-shadow-lg: 0 4px 8px -2px oklch(var(--av-shadow-color) / 0.08), 0 28px 60px -20px color-mix(in oklab, var(--av-accent-500) 60%, transparent);
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 8%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 16%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 18%;
  --av-kpi-glow: 0.3;
  --av-kpi-bar: 3px;
  --av-chart-radius: 6;
  --av-chart-dash: 0;
  --av-chart-stroke: 3;
  --av-chart-area: 0.5;
  --av-chart-curve: smooth;
}
:root[data-av-style="duotone"][data-bs-theme="dark"],
:root:where(:not([data-av-style]), [data-av-style="auto"]):is([data-av-preset="catawba"])[data-bs-theme="dark"] {
  --av-shadow-sm: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.06), 0 10px 26px -14px color-mix(in oklab, var(--av-accent-500) 40%, transparent);
  --av-shadow-md: inset 0 1px 0 oklch(var(--av-highlight-color) / 0.07), 0 18px 40px -16px color-mix(in oklab, var(--av-accent-500) 45%, transparent);
  --av-mesh-a: radial-gradient(ellipse 65% 55% at 0% 0%, color-mix(in oklab, var(--av-color-primary) 0%, transparent) 0%, transparent 70%);
  --av-mesh-b: radial-gradient(ellipse 60% 55% at 100% 100%, color-mix(in oklab, var(--av-accent-500) 20%, transparent) 0%, transparent 70%);
  --av-mesh-c: none;
}

:root[data-av-radius="sharp"] { --av-radius-scale: 0; }
:root[data-av-radius="subtle"] { --av-radius-scale: 0.5; }
:root[data-av-radius="rounded"] { --av-radius-scale: 1; }
:root[data-av-radius="pill"] { --av-radius-scale: 1.6; }

:root[data-av-depth="plain"] {
  --av-kpi-fill: 0%;
  --av-kpi-edge: 0%;
  --av-kpi-chip: 12%;
  --av-kpi-glow: 0;
  --av-kpi-bar: 3px;
}

/* Texture and translucency are decoration, so a reader who asks for more
   contrast or less transparency gets neither. `[data-av-preset]` rather than
   :root so the rule outranks a preset block on source order. */
[data-av-contrast="high"] { --av-grain: none; }
@media (prefers-contrast: more) {
  :root, [data-av-preset] { --av-grain: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root, [data-av-preset] {
    --av-glass-bg: var(--av-surface-raised);
    --av-glass-blur: 0px;
  }
}


/* Nav skin — see tools/build-tokens.mjs for why this is an axis. */
[data-av-nav-skin="plain"] {
  --av-sidebar-bg: var(--av-surface-raised);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-text: var(--av-text-secondary);
  --av-sidebar-text-strong: var(--av-text-primary);
  --av-sidebar-title: var(--av-text-muted);
  --av-sidebar-hover-bg: var(--av-surface-sunken);
  --av-sidebar-active-bg: var(--av-color-primary-subtle);
  --av-sidebar-active-text: var(--av-color-primary-text);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-border-strong);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-color-primary) 14%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 5%, transparent);
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
}
[data-av-nav-skin="plain"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-nav-skin="plain"] {
  --av-sidebar-bg: var(--av-neutral-950);
  --av-sidebar-border: var(--av-neutral-850);
  --av-sidebar-text: var(--av-neutral-400);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: var(--av-neutral-400);
  --av-sidebar-hover-bg: var(--av-neutral-900);
  --av-sidebar-active-bg: var(--av-neutral-850);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-neutral-700);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-color-primary) 22%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
}

[data-av-nav-skin="tint"] {
  --av-sidebar-bg: var(--av-surface-sunken);
  --av-sidebar-border: var(--av-border-subtle);
  --av-sidebar-text: var(--av-text-secondary);
  --av-sidebar-text-strong: var(--av-text-primary);
  --av-sidebar-title: var(--av-text-secondary);
  --av-sidebar-hover-bg: var(--av-surface-sunken);
  --av-sidebar-active-bg: var(--av-color-primary-subtle);
  --av-sidebar-active-text: var(--av-color-primary-text);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-border-strong);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-color-primary) 14%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 5%, transparent);
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
}
[data-av-nav-skin="tint"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-nav-skin="tint"] {
  --av-sidebar-bg: var(--av-neutral-900);
  --av-sidebar-border: var(--av-neutral-850);
  --av-sidebar-text: var(--av-neutral-400);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: var(--av-neutral-300);
  --av-sidebar-hover-bg: var(--av-neutral-900);
  --av-sidebar-active-bg: var(--av-neutral-850);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-color-primary);
  --av-sidebar-scroll-thumb: var(--av-neutral-700);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-color-primary) 22%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-color-primary);
  --av-sidebar-cta-text: var(--av-text-on-primary);
}

[data-av-nav-skin="ink"] {
  --av-sidebar-bg: var(--av-neutral-950);
  --av-sidebar-border: var(--av-neutral-850);
  --av-sidebar-text: var(--av-neutral-400);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: var(--av-neutral-400);
  --av-sidebar-hover-bg: var(--av-neutral-900);
  --av-sidebar-active-bg: var(--av-neutral-850);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: var(--av-neutral-700);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: oklch(from var(--av-sidebar-cta-bg) clamp(.13, (.62 - l) * 100, .99) 0 0);
}
[data-av-nav-skin="ink"][data-bs-theme="dark"],
[data-bs-theme="dark"] [data-av-nav-skin="ink"] {
  --av-sidebar-bg: var(--av-neutral-950);
  --av-sidebar-border: var(--av-neutral-850);
  --av-sidebar-text: var(--av-neutral-400);
  --av-sidebar-text-strong: var(--av-neutral-0);
  --av-sidebar-title: var(--av-neutral-400);
  --av-sidebar-hover-bg: var(--av-neutral-900);
  --av-sidebar-active-bg: var(--av-neutral-850);
  --av-sidebar-active-text: var(--av-neutral-0);
  --av-sidebar-marker: var(--av-accent-500);
  --av-sidebar-scroll-thumb: var(--av-neutral-700);
  --av-sidebar-sweep-from: color-mix(in oklab, var(--av-accent-500) 26%, transparent);
  --av-sidebar-sweep-to: color-mix(in oklab, var(--av-accent-500) 4%, transparent);
  --av-sidebar-cta-bg: var(--av-accent-500);
  --av-sidebar-cta-text: oklch(from var(--av-sidebar-cta-bg) clamp(.13, (.62 - l) * 100, .99) 0 0);
}

} /* @layer tokens */

/*!
 * AdminVora — generated from src/scss. Do not edit by hand.
 * Rebuild with: npm run build:css
 */
/*!
 * AdminVora — main stylesheet entry.
 *
 * Layer order is declared once in _layers.scss; every partial then puts its rules
 * inside the layer it belongs to, so source order here does not affect the cascade.
 * Design tokens are a separate stylesheet (src/css/tokens.css) generated by
 * tools/build-tokens.mjs — link it before this file.
 */
@layer reset, base, components, plugins, styles, utilities;
@layer base {
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-cyrillic-ext-opsz-normal.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-cyrillic-opsz-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-greek-ext-opsz-normal.woff2") format("woff2");
    unicode-range: U+1F00-1FFF;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-greek-opsz-normal.woff2") format("woff2");
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-vietnamese-opsz-normal.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-ext-opsz-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-opsz-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-ext-opsz-italic.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "InterVariable";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/inter/inter-latin-opsz-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "PlusJakartaSansVariable";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  }
  @font-face {
    font-family: "PlusJakartaSansVariable";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-vietnamese-wght-normal.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  }
  @font-face {
    font-family: "PlusJakartaSansVariable";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "PlusJakartaSansVariable";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "JetBrainsMonoVariable";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  }
  @font-face {
    font-family: "JetBrainsMonoVariable";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  }
  @font-face {
    font-family: "JetBrainsMonoVariable";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-greek-wght-normal.woff2") format("woff2");
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
  }
  @font-face {
    font-family: "JetBrainsMonoVariable";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-vietnamese-wght-normal.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  }
  @font-face {
    font-family: "JetBrainsMonoVariable";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "JetBrainsMonoVariable";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "FrauncesVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/fraunces/fraunces-vietnamese-opsz-normal.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  }
  @font-face {
    font-family: "FrauncesVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/fraunces/fraunces-latin-ext-opsz-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "FrauncesVariable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../vendor/fonts/fraunces/fraunces-latin-opsz-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "NunitoVariable";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../vendor/fonts/nunito/nunito-cyrillic-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
  }
  @font-face {
    font-family: "NunitoVariable";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../vendor/fonts/nunito/nunito-cyrillic-wght-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
  }
  @font-face {
    font-family: "NunitoVariable";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../vendor/fonts/nunito/nunito-vietnamese-wght-normal.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  }
  @font-face {
    font-family: "NunitoVariable";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../vendor/fonts/nunito/nunito-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "NunitoVariable";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("../vendor/fonts/nunito/nunito-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: "SpaceGroteskVariable";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../vendor/fonts/space-grotesk/space-grotesk-vietnamese-wght-normal.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
  }
  @font-face {
    font-family: "SpaceGroteskVariable";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../vendor/fonts/space-grotesk/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  @font-face {
    font-family: "SpaceGroteskVariable";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../vendor/fonts/space-grotesk/space-grotesk-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
}
@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
  }
  * {
    margin: 0;
  }
  html {
    -webkit-text-size-adjust: 100%;
  }
  body {
    min-block-size: 100dvh;
  }
  img, svg, video {
    display: block;
    max-inline-size: 100%;
  }
  input, button, textarea, select {
    font: inherit;
    color: inherit;
  }
  button {
    cursor: pointer;
  }
  p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
  }
  fieldset {
    border: 0;
    padding: 0;
    min-inline-size: 0;
  }
  legend {
    padding: 0;
  }
}
/* ── Base ────────────────────────────────────────────────────────────── */
@layer base {
  :root {
    --av-sidebar-width: 264px;
    --av-sidebar-width-collapsed: 72px;
    --av-topbar-height: 64px;
    --av-content-padding: var(--av-space-6);
  }
  @media (max-width: 575.98px) {
    :root {
      --av-content-padding: var(--av-space-4);
    }
  }
  body {
    font-family: var(--av-font-sans);
    font-size: var(--av-font-size-base);
    line-height: var(--av-line-height-normal);
    color: var(--av-text-primary);
    /* Three ambient washes over the flat surface colour. They are what stops a
       large empty page reading as a grey slab; the colour underneath is still
       --av-surface-base, so nothing downstream has to know they are here. */
    background-color: var(--av-surface-base);
    /* --av-grain is the material's paper tooth, `none` unless a preset sets it. */
    background-image: var(--av-grain), var(--av-mesh-a), var(--av-mesh-b), var(--av-mesh-c);
    background-attachment: fixed;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  [data-bs-theme=dark] body {
    -webkit-font-smoothing: auto;
  }
  /* fixed attachment triggers repaint-per-scroll on mobile compositors. */
  @media (max-width: 767.98px) {
    body {
      background-attachment: scroll;
    }
  }
  /* Scrollbars. Firefox gets the two-keyword form; WebKit/Blink the pseudo
     elements. Both are scoped to a token so a preset re-themes them. */
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--av-border-strong) transparent;
  }
  ::-webkit-scrollbar {
    inline-size: 10px;
    block-size: 10px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--av-border-default);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: var(--av-radius-full);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--av-border-strong);
    background-clip: content-box;
  }
  :where(h1, h2, h3, h4, h5, h6) {
    font-family: var(--av-font-display);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    text-wrap: balance;
  }
  a {
    color: var(--av-text-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in oklch, currentColor 40%, transparent);
    transition: text-decoration-color var(--av-duration-fast) var(--av-ease-standard);
  }
  a:hover {
    text-decoration-color: currentColor;
  }
  ::selection {
    background: color-mix(in oklch, var(--av-color-primary) 25%, transparent);
  }
  :where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
    border-radius: var(--av-radius-sm);
  }
  /* The boot/theming suppression and the reduced-motion reset used to live here.
     Both are overrides that need !important, so they moved to
     utilities/_motion.scss — the one layer where the standards allow it. */
}
/* ── Components ──────────────────────────────────────────────────────── */
@layer components {
  /* ══ APP SHELL ══════════════════════════════════════════════════════ */
  .av-skip-link {
    position: absolute;
    inset-block-start: var(--av-space-2);
    inset-inline-start: var(--av-space-2);
    z-index: var(--av-z-max);
    padding: var(--av-space-2) var(--av-space-4);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    box-shadow: var(--av-shadow-lg);
    translate: 0 calc(-100% - var(--av-space-4) - var(--av-space-2));
    transition: translate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-skip-link:focus {
    translate: 0;
  }
  .av-shell {
    display: grid;
    grid-template-columns: var(--av-sidebar-current, var(--av-sidebar-width)) 1fr;
    grid-template-areas: "sidebar main";
    block-size: 100dvh;
    overflow: hidden;
    /* The shell covers the body completely, so it has to carry the ambient mesh
       itself or the app pages lose it. Only .av-content scrolls, so the wash
       stays put behind the scrolling content — which is the point of it. */
    background-color: var(--av-surface-base);
    background-image: var(--av-mesh-a), var(--av-mesh-b), var(--av-mesh-c);
    transition: grid-template-columns var(--av-duration-normal) var(--av-ease-standard);
  }
  [data-av-sidebar=collapsed] {
    --av-sidebar-current: var(--av-sidebar-width-collapsed);
  }
  [data-av-sidebar=hidden] {
    --av-sidebar-current: 0px;
  }
  .av-main {
    grid-area: main;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "topbar" "content" "footer";
    min-inline-size: 0; /* without this, wide tables push the sidebar off-screen */
    overflow: hidden;
  }
  /* A player bar (components/player) docks as one more row under the footer,
     so it spans the content column and the page scrolls in the room left. */
  .av-main:has(> .av-player) {
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "topbar" "content" "footer" "player";
  }
  .av-content {
    grid-area: content;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  /* The skip link sends focus here, and `tabindex="-1"` means it can receive it.
     A blanket `outline: none` used to sit on the rule above, which silently
     removed the one confirmation a keyboard user gets that the skip link worked.
     `:focus-visible` is the whole answer: programmatic focus on a -1 element
     does not match it for a mouse click, so the ring appears when someone
     arrives by keyboard and never when they click into the page. */
  .av-content:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: calc(var(--av-focus-width) * -1);
  }
  /* docs/03-design-system/05-spacing-and-layout.md: fluid "fills the available
     width", boxed is "capped at 1400px and centred". The cap belongs to boxed
     alone — a 1600px ceiling on fluid (with no auto margin to boot) left a
     dead gutter down the right of every ultrawide screen and made the two
     modes differ only in where the emptiness sat. */
  .av-content > .container-fluid {
    padding: var(--av-content-padding);
  }
  /* Page rhythm, stated once. Every page body in this product is a stack of
     top-level blocks a `--av-space-4` apart, and that gap used to be written as
     `style="margin-block-end: var(--av-space-4)"` on each block: 44 of them
     across 26 files, outside every `@layer`, answering to no specificity
     ceiling, and invisible to `lint-css.mjs` — the exact hazard already
     recorded against the shop offer section and the aside column.

     `:where()` is what makes it a *default* rather than a rule, and it is
     load-bearing. There is no `layout` layer — `_layers.scss` declares
     `reset, base, components, plugins, utilities`, so these partials compile
     into `components` alongside every component. Written plainly this selector
     is 0-2-0 and out-specifies the 0-1-0 component rules that are supposed to
     refuse it: the first version silently flattened `.av-subnav`'s -16px lift
     to +16px on fourteen account pages, and `tests/visual.mjs` is what said so.
     Inside `:where()` the ancestors contribute nothing and `* + *` never did,
     so the whole selector is **0-0-0** and anything at all overrides it —
     which is the correct power for a default. Three do, and each was measured
     rather than assumed: `.av-tab-nav-bar` sits flush against the block it
     controls, `.av-subnav` is pulled up into the rail's own gap, and a
     `<dialog>`'s `margin: auto` is what centres it. */
  :where(.av-content > .container-fluid) > * + * {
    margin-block-start: var(--av-space-4);
  }
  [data-av-width=boxed] .av-content > .container-fluid {
    max-inline-size: var(--av-content-max, 1400px);
    margin-inline: auto;
  }
  /* A jumped-to section lands below the sticky jump bar (components/_example), not under it.
     No scroll-behavior here: it would also animate every scripted scrollTop on the page. */
  .av-content:has(.av-jump--sticky) {
    scroll-padding-block-start: calc(var(--av-space-12) + var(--av-space-2));
  }
  /* Page transitions: a same-origin link fades the old content out and the new
     one in with a short rise, while the rail and topbar hold still. Browsers
     without cross-document view transitions navigate as before. Durations are
     tokens, so the motion axis and prefers-reduced-motion zero them. The names
     sit on the shell's own children only: a second element sharing a name
     cancels the transition. */
  @view-transition {
    navigation: auto;
  }
  .av-shell > .av-sidebar {
    view-transition-name: av-sidebar;
  }
  .av-main > .av-topbar {
    view-transition-name: av-topbar;
  }
  .av-main > .av-content {
    view-transition-name: av-content;
  }
  ::view-transition-group(av-sidebar),
  ::view-transition-group(av-topbar) {
    animation: none;
  }
  ::view-transition-old(av-sidebar), ::view-transition-old(av-topbar) {
    display: none;
  }
  ::view-transition-new(av-sidebar), ::view-transition-new(av-topbar) {
    animation: none;
  }
  ::view-transition-old(root),
  ::view-transition-old(av-content) {
    animation: av-shell-out var(--av-duration-fast) var(--av-ease-accelerate) both;
  }
  ::view-transition-new(root) {
    animation: av-shell-in var(--av-duration-normal) var(--av-ease-decelerate) both;
  }
  ::view-transition-new(av-content) {
    animation: av-shell-rise var(--av-duration-normal) var(--av-ease-decelerate) both;
  }
  ::view-transition-group(av-content) {
    animation-duration: var(--av-duration-normal);
  }
  @keyframes av-shell-out {
    to {
      opacity: 0;
    }
  }
  @keyframes av-shell-in {
    from {
      opacity: 0;
    }
  }
  @keyframes av-shell-rise {
    from {
      opacity: 0;
      transform: translateY(var(--av-space-2));
    }
  }
}
@layer components {
  /* Sidebar ─────────────────────────────────────────────────────────── */
  .av-sidebar {
    grid-area: sidebar;
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    /* Every colour here comes from the --av-sidebar-* slice rather than from the
       page surfaces, so a preset can hand the rail an ink treatment beside a
       light canvas without a single rule in this file naming a colour. The
       defaults are exactly the page semantics they replace. */
    background: var(--av-sidebar-bg);
    border-inline-end: 1px solid var(--av-sidebar-border);
    overflow: hidden;
    z-index: var(--av-z-sidebar);
  }
  .av-sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-2);
    min-block-size: var(--av-topbar-height);
    padding-inline: var(--av-space-4);
    border-block-end: 1px solid var(--av-sidebar-border);
  }
  .av-brand {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    text-decoration: none;
    color: var(--av-text-primary);
    min-inline-size: 0;
  }
  /* Scoped: .av-brand is reused on the auth cards, which sit on a page surface
     and must keep the page's ink even when a preset darkens the rail. */
  .av-sidebar .av-brand {
    color: var(--av-sidebar-text-strong);
  }
  .av-brand__mark {
    inline-size: 30px;
    block-size: 30px;
    flex: none;
    border-radius: var(--av-radius-md);
    display: block;
  }
  .av-brand__text {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-bold);
    letter-spacing: -0.02em;
    white-space: nowrap;
  }
  .av-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--av-space-3);
    scrollbar-width: thin;
    scrollbar-color: var(--av-border-strong) transparent;
  }
  .av-sidebar__nav::-webkit-scrollbar {
    inline-size: 6px;
  }
  .av-sidebar__nav::-webkit-scrollbar-thumb {
    background: var(--av-sidebar-scroll-thumb);
    border-radius: var(--av-radius-full);
  }
  .av-sidebar__footer {
    padding: var(--av-space-4);
    border-block-start: 1px solid var(--av-sidebar-border);
    color: var(--av-sidebar-text);
  }
  /* The footer borrows two page components — a hint and a progress track — that
     were written against the page surfaces. On an ink rail they would be
     grey-on-black and an invisible track, so both are re-pointed at the rail's
     own slice. Scoped to .av-sidebar so the page copies are untouched. */
  .av-sidebar .av-field-line__hint {
    color: var(--av-sidebar-text);
  }
  .av-sidebar .av-progress {
    background: var(--av-sidebar-hover-bg);
  }
  /* Re-point the fill pair rather than restating the gradient — see _button.scss. */
  .av-sidebar .av-btn--primary {
    --av-btn-fill: var(--av-sidebar-cta-bg);
    --av-btn-fill-hover: color-mix(in oklab, var(--av-sidebar-cta-bg) 88%, var(--av-neutral-0));
    --av-btn-ink: var(--av-sidebar-cta-text);
  }
  /* Outline too: on its own it keeps the page's grey ink and border, which all but vanish on an ink rail. */
  .av-sidebar .av-btn--outline {
    border-color: color-mix(in oklab, var(--av-sidebar-text) 45%, transparent);
    color: var(--av-sidebar-text-strong);
  }
  .av-sidebar .av-btn--outline:hover {
    border-color: var(--av-sidebar-text);
    background: var(--av-sidebar-hover-bg);
    color: var(--av-sidebar-text-strong);
  }
  .av-sidebar .av-btn--ghost {
    color: var(--av-sidebar-text);
  }
  .av-sidebar .av-btn--ghost:hover {
    background: var(--av-sidebar-hover-bg);
    color: var(--av-sidebar-text-strong);
  }
  .av-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  /* The section heading is now a <summary>, so it is a real control: focusable,
     operable by Enter and Space, and announced with its expanded state — all
     from the platform, with no JavaScript. That last part is why it is
     <details> rather than the `data-av-collapse` disclosure used elsewhere: a
     menu that needs a working bundle to open is the wrong trade in the one
     region of the page that has to survive one failing.

     It keeps the `.av-menu__title` class so the collapsed rail's existing rule
     still hides it and no second name has to be threaded through the layout. */
  .av-menu__title {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-widest);
    text-transform: uppercase;
    color: var(--av-sidebar-title);
    padding: var(--av-space-4) var(--av-space-3) var(--av-space-1);
    white-space: nowrap;
    cursor: pointer;
    /* Both are needed: Safari draws the triangle through a -webkit
       pseudo-element, everything else through the summary's own list marker. */
    list-style: none;
  }
  .av-menu__title::-webkit-details-marker {
    display: none;
  }
  .av-menu__title:hover {
    color: var(--av-sidebar-text-strong);
  }
  .av-menu__title:focus-visible {
    outline: 2px solid var(--av-focus-ring);
    outline-offset: -2px;
    border-radius: var(--av-radius-sm);
  }
  .av-menu__title-text {
    flex: 1;
    min-inline-size: 0;
  }
  .av-menu__caret {
    flex: none;
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
    transition: rotate var(--av-duration-fast) var(--av-ease-standard);
  }
  /* Reads the element's own open state rather than a class toggled beside it,
     so the caret and the announced state cannot disagree. */
  .av-menu__disclosure[open] .av-menu__caret {
    rotate: 180deg;
  }
  /* `display` is set only on the open state, and that is not a tidiness
     preference — it is the same trap `[hidden]` already sprang on this
     codebase. A browser hides the contents of a closed <details> with its own
     `display: none`, and an author `display` declaration beats a UA one at any
     specificity. Setting `display: flex` unconditionally left every group
     rendered and the whole feature silently inert: all 52 links stayed visible
     with five of six groups shut.

     Everything that is not `display` can stay unconditional — it costs nothing
     while the list is hidden and keeps the two rules from drifting. */
  .av-menu__group-list {
    flex-direction: column;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
  }
  .av-menu__disclosure[open] > .av-menu__group-list {
    display: flex;
  }
  .av-menu__divider {
    block-size: 1px;
    background: var(--av-sidebar-border);
    margin: var(--av-space-3) var(--av-space-3);
  }
  .av-menu__link {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    min-block-size: 42px;
    padding-inline: var(--av-space-3);
    border-radius: var(--av-radius-md);
    color: var(--av-sidebar-text);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    text-decoration: none;
    inline-size: 100%;
    text-align: start;
    background: none;
    border: 0;
    position: relative;
    white-space: nowrap;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-menu__link:hover {
    background: var(--av-sidebar-hover-bg);
    color: var(--av-sidebar-text-strong);
  }
  /* Keyboard parity: without this a Tab through the rail changed nothing but the
     focus ring, which on an ink theme is the one place the ring is hardest to see. */
  .av-menu__link:focus-visible {
    background: var(--av-sidebar-hover-bg);
    color: var(--av-sidebar-text-strong);
  }
  .av-menu__icon {
    flex: none;
  }
  .av-menu__label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .av-menu__badge {
    flex: none;
    display: inline-grid;
    place-items: center;
    min-inline-size: 20px;
    block-size: 20px;
    padding-inline: var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: var(--av-sidebar-cta-bg);
    color: var(--av-sidebar-cta-text);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-menu__caret {
    flex: none;
    inline-size: 16px;
    block-size: 16px;
    transition: rotate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-menu__item--open > .av-menu__link .av-menu__caret {
    rotate: 90deg;
  }
  [dir=rtl] .av-menu__caret {
    scale: -1 1;
  }
  [dir=rtl] .av-menu__item--open > .av-menu__link .av-menu__caret {
    rotate: -90deg;
  }
  /* The active row is a gradient rather than a flat tint so it reads as lit
     from the rail side, which is where the 3px marker sits. It fades out along
     the inline axis, so a long label never ends on a hard colour edge. */
  /* A gradient has no logical direction keyword, so the angle travels as a
     custom property that the [dir="rtl"] rule below flips — the same tactic
     this codebase uses for transform and clip-path. */
  .av-menu {
    --av-menu-sweep: 90deg;
  }
  [dir=rtl] .av-menu {
    --av-menu-sweep: 270deg;
  }
  .av-menu__item--active > .av-menu__link {
    background-color: var(--av-sidebar-active-bg);
    background-image: linear-gradient(var(--av-menu-sweep), var(--av-sidebar-sweep-from) 0%, var(--av-sidebar-sweep-to) 100%);
    color: var(--av-sidebar-active-text);
    font-weight: var(--av-font-weight-semibold);
    box-shadow: 0 2px 10px color-mix(in oklab, var(--av-color-primary) 14%, transparent);
  }
  [data-bs-theme=dark] .av-menu__item--active > .av-menu__link {
    box-shadow: 0 0 18px color-mix(in oklab, var(--av-color-primary) 18%, transparent);
  }
  /* The icon nudges toward the label on hover — a small, cheap sign that the
     row is live. translate is used rather than margin so nothing reflows. */
  .av-menu__link .av-menu__icon {
    transition: translate var(--av-duration-fast) var(--av-ease-spring);
  }
  .av-menu__link:hover .av-menu__icon {
    translate: 2px 0;
  }
  [dir=rtl] .av-menu__link:hover .av-menu__icon {
    translate: -2px 0;
  }
  .av-menu__item--active > .av-menu__link::before {
    content: "";
    position: absolute;
    inset-inline-start: calc(var(--av-space-3) * -1);
    inset-block: 25%;
    inline-size: 3px;
    border-radius: 0 var(--av-radius-full) var(--av-radius-full) 0;
    background: var(--av-sidebar-marker);
  }
  [dir=rtl] .av-menu__item--active > .av-menu__link::before {
    border-radius: var(--av-radius-full) 0 0 var(--av-radius-full);
  }
  /* Submenu — grid-rows technique animates to auto height without JS */
  .av-menu__sub {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-menu__sub > .av-menu__sub-inner {
    overflow: hidden;
    min-block-size: 0;
  }
  .av-menu__item--open > .av-menu__sub {
    grid-template-rows: 1fr;
  }
  .av-menu__sub .av-menu__link {
    min-block-size: 36px;
    padding-inline-start: calc(var(--av-space-3) + 20px + var(--av-space-3));
    font-weight: var(--av-font-weight-normal);
  }
  /* Collapsed state — icons only */
  [data-av-sidebar=collapsed] .av-menu__label,
  [data-av-sidebar=collapsed] .av-menu__title,
  [data-av-sidebar=collapsed] .av-menu__caret,
  [data-av-sidebar=collapsed] .av-menu__badge,
  [data-av-sidebar=collapsed] .av-sidebar .av-brand__text,
  [data-av-sidebar=collapsed] .av-sidebar__footer,
  [data-av-sidebar=collapsed] .av-menu__sub {
    display: none;
  }
  [data-av-sidebar=collapsed] .av-menu__link {
    justify-content: center;
    padding-inline: 0;
  }
  [data-av-sidebar=collapsed] .av-sidebar__brand {
    justify-content: center;
    padding-inline: var(--av-space-2);
  }
  /* Collapsed: the toggle is the only control left, chevron flipped outward */
  [data-av-sidebar=collapsed] .av-sidebar__brand .av-brand {
    display: none;
  }
  /* Two controls the sidebar sizes itself, because their height answers to
     this rail's density rather than to the button scale. Both were written
     inline on the shared partial, which put a layout decision about the
     sidebar in the one place the sidebar's own stylesheet could not see it.

     Both carry the rail as context rather than standing alone, because
     `.av-btn` sets the same custom property at the same specificity in this
     same layer and is `@use`d after this partial — so a bare
     `.av-sidebar-collapse` loses on source order and silently renders at 44px.
     Real specificity, not position, exactly as `.av-topbar .av-btn--icon`
     already does two files away. */
  .av-sidebar .av-sidebar-collapse {
    --av-btn-height: 30px;
  }
  .av-sidebar__footer .av-btn {
    --av-btn-height: 36px;
  }
  .av-sidebar-collapse .av-icon {
    transition: rotate var(--av-duration-normal) var(--av-ease-standard);
  }
  [data-av-sidebar=collapsed] .av-sidebar-collapse .av-icon {
    rotate: 180deg;
  }
  .av-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--av-z-sidebar) - 1);
    background: var(--av-overlay);
    border: 0;
    padding: 0;
    opacity: 1;
    transition: opacity var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-sidebar-backdrop[hidden] {
    display: none;
  }
  /* Mobile: off-canvas */
  @media (max-width: 991.98px) {
    .av-shell {
      grid-template-columns: 1fr;
      grid-template-areas: "main";
    }
    .av-sidebar {
      position: fixed;
      inset-block: 0;
      inset-inline-start: 0;
      inline-size: var(--av-sidebar-width);
      translate: -100% 0;
      transition: translate var(--av-duration-normal) var(--av-ease-emphasized);
      box-shadow: var(--av-shadow-xl);
    }
    [dir=rtl] .av-sidebar {
      translate: 100% 0;
    }
    .av-sidebar.is-mobile-open {
      translate: 0 0;
    }
    /* Collapsed desktop pref does not apply off-canvas */
    [data-av-sidebar=collapsed] .av-menu__label,
    [data-av-sidebar=collapsed] .av-menu__title,
    [data-av-sidebar=collapsed] .av-menu__caret,
    [data-av-sidebar=collapsed] .av-menu__badge,
    [data-av-sidebar=collapsed] .av-sidebar .av-brand__text,
    [data-av-sidebar=collapsed] .av-sidebar__footer {
      display: revert;
    }
    [data-av-sidebar=collapsed] .av-sidebar__brand .av-brand {
      display: flex;
    }
    [data-av-sidebar=collapsed] .av-sidebar-collapse .av-icon {
      rotate: none;
    }
    [data-av-sidebar=collapsed] .av-menu__sub {
      display: grid;
    }
    [data-av-sidebar=collapsed] .av-menu__link {
      justify-content: flex-start;
      padding-inline: var(--av-space-3);
    }
  }
  @media (min-width: 992px) {
    .av-sidebar-backdrop {
      display: none;
    }
    .av-topbar .av-topbar__menu-btn {
      display: none;
    }
  }
  /* The plan-usage sentence above the bar in the sidebar footer. It owns the
     gap between itself and the bar, because the two are one readout and the
     footer should not have to know that.

     Both ends are declared, and the `0` is load-bearing: `.av-field-line__hint`
     carries a 6px top margin for the field it normally sits under, and there is
     no field here — the sentence is the first thing in the footer. Writing only
     the end margin let that 6px back in. A `0` in a declaration being replaced is
     a value, not padding in the text.

     Scoped to the footer for the same reason `.av-book__spread` is scoped to the
     table: both classes are 0-1-0, so an unscoped rule ties with
     `.av-field-line__hint` and is decided by `@use` order — which puts
     `components/field` after `layout/sidebar`, so the hint won and the footer
     grew 6px on every page in the product. The pixel diff caught it; nothing
     static could. */
  .av-sidebar__footer .av-sidebar__usage-note {
    margin-block: 0 var(--av-space-2);
  }
}
@layer components {
  /* Topbar ──────────────────────────────────────────────────────────── */
  .av-topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    min-block-size: var(--av-topbar-height);
    padding-inline: var(--av-space-4);
    background: var(--av-surface-raised);
    border-block-end: 1px solid var(--av-border-subtle);
    z-index: var(--av-z-topbar);
  }
  /* Content does not scroll under the topbar in this shell, so the blur has
     nothing to soften — the translucency is the point. It lets the shell's
     ambient mesh tint the bar so it belongs to the page instead of capping it. */
  @supports (backdrop-filter: blur(1px)) {
    .av-topbar {
      background: var(--av-glass-bg);
      backdrop-filter: blur(var(--av-glass-blur)) saturate(180%);
      box-shadow: 0 1px 0 var(--av-glass-border), var(--av-shadow-sm);
    }
  }
  .av-topbar__start {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    min-inline-size: 0;
  }
  .av-topbar__end {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
    margin-inline-start: auto;
  }
  .av-search-trigger {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    min-block-size: 38px;
    padding-inline: var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
    /* --av-text-subtle on the sunken fill measures 2.74:1 at its worst (harbour,
       light) and clears 4.5:1 in none of the 32 preset/mode combinations — the
       widest contrast failure in the product, on the one control every page
       carries. It reads as placeholder text, but it is a button with a label,
       and a label is held to 4.5:1. --av-text-secondary is the first token that
       clears it everywhere (worst 5.39:1); --av-text-muted does not (3.82:1),
       which is why the obvious one-step nudge was measured rather than assumed. */
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard);
  }
  /* Hover must move *towards* contrast: it used to drop from subtle to muted,
     which reads as a lift only because both were unreadable. */
  .av-search-trigger:hover {
    border-color: var(--av-border-strong);
    color: var(--av-text-primary);
  }
  .av-search-trigger__text {
    padding-inline-end: var(--av-space-8);
  }
  .av-kbd {
    display: inline-grid;
    place-items: center;
    min-inline-size: 20px;
    padding: 1px var(--av-space-1);
    border: 1px solid var(--av-border-default);
    border-block-end-width: 2px;
    border-radius: var(--av-radius-xs);
    background: var(--av-surface-raised);
    color: var(--av-text-muted);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-2xs);
  }
  @media (max-width: 767.98px) {
    .av-search-trigger__text, .av-search-trigger__kbd {
      display: none;
    }
    .av-search-trigger {
      border: 0;
      background: none;
    }
  }
  /* position: relative anchors .av-notif__badge, which superseded the old
     .av-topbar__dot when the bell became a real panel. */
  .av-topbar .av-btn--icon {
    --av-btn-height: 38px;
    position: relative;
  }
  /* Only one of the pair shows, depending on resolved mode */
  .av-mode-icon--dark {
    display: none;
  }
  [data-bs-theme=dark] .av-mode-icon--dark {
    display: block;
  }
  [data-bs-theme=dark] .av-mode-icon--light {
    display: none;
  }
  .av-topbar__profile {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    padding: var(--av-space-1) var(--av-space-2);
    margin-inline-start: var(--av-space-1);
    border: 0;
    border-radius: var(--av-radius-md);
    background: none;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-topbar__profile:hover {
    background: var(--av-surface-sunken);
  }
  .av-topbar__profile-name {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-topbar__profile-role {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  .av-topbar__profile-meta {
    text-align: start;
    line-height: 1.3;
  }
  @media (max-width: 575.98px) {
    .av-topbar__profile-meta {
      display: none;
    }
  }
  /* The avatar moved to components/_avatar.scss — it was never topbar chrome. */
}
@layer components {
  /* Footer ──────────────────────────────────────────────────────────── */
  .av-footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-4);
    padding: var(--av-space-3) var(--av-content-padding);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
}
@layer components {
  /* ══ PUBLIC PAGE ════════════════════════════════════════════════════
     The layout for the pages a product shows people who are not signed in:
     pricing, FAQ, the help centre, the legal texts, the changelog and the
     status page. They are deliberately *not* the app shell — there is no
     sidebar to collapse and no workspace to be inside — and just as
     deliberately not a second design system: every block on them is a
     component the admin already ships, which is the same argument the
     storefront settled. A buyer re-themes once and both follow.

     `.av-footer` is not reused here for one concrete reason: its first
     declaration is `grid-area: footer`, which belongs to the shell's grid and
     means nothing outside it. A class whose first line is a grid area is a
     class that belongs to one grid. */
  .av-public {
    min-block-size: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--av-surface-base);
  }
  .av-public__bar {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-sticky);
    display: flex;
    align-items: center;
    gap: var(--av-space-6);
    padding: var(--av-space-3) var(--av-space-6);
    border-block-end: 1px solid var(--av-border-subtle);
    background: var(--av-glass-bg);
    backdrop-filter: blur(var(--av-glass-blur));
  }
  .av-public__nav {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
    margin-inline-start: auto;
    list-style: none;
    padding: 0;
    margin-block: 0;
  }
  /* The rail scrolls rather than wraps below 640px: a header that grows to two
     rows pushes the page down by its own height on the narrowest screen there
     is. `scrollbar-width: none` because the row is four items — the affordance
     is the overflow itself, not a bar under it. */
  @media (max-width: 639.98px) {
    .av-public__bar > nav {
      inline-size: 100%;
      min-inline-size: 0;
    }
    .av-public__nav {
      overflow-x: auto;
      scrollbar-width: none;
      margin-inline-start: 0;
    }
    .av-public__bar {
      flex-wrap: wrap;
    }
  }
  .av-public__link {
    display: inline-flex;
    align-items: center;
    padding: var(--av-space-2) var(--av-space-3);
    border-radius: var(--av-radius-md);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-public__link:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-public__link[aria-current=page] {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-public__main {
    flex: 1;
    inline-size: 100%;
    max-inline-size: 1080px;
    margin-inline: auto;
    padding: var(--av-space-8) var(--av-space-6) var(--av-space-12);
  }
  /* The same page rhythm the app shell gives `.av-content > .container-fluid`,
     and the same 0-0-0 power: inside `:where()` the ancestor contributes
     nothing and `* + *` never did, so any component that wants to sit flush
     against its neighbour still can. Written plainly it would be 0-2-0 and
     would out-specify the 0-1-0 component rules meant to refuse it — the
     mistake the shell version made once and `tests/visual.mjs` caught. */
  :where(.av-public__main) > * + * {
    margin-block-start: var(--av-space-8);
  }
  /* The reading measure, for a page that is prose rather than panels. The legal
     texts set it; pricing and status do not. */
  .av-public__main--narrow {
    max-inline-size: 760px;
  }
  .av-public__head {
    text-align: center;
    margin-block-end: var(--av-space-8);
  }
  .av-public__head--start {
    text-align: start;
  }
  .av-public__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-4xl);
    font-weight: var(--av-font-weight-bold);
    line-height: var(--av-line-height-tight);
    margin: 0;
  }
  .av-public__lede {
    max-inline-size: 60ch;
    margin: var(--av-space-3) auto 0;
    color: var(--av-text-secondary);
  }
  .av-public__head--start .av-public__lede {
    margin-inline: 0;
  }
  .av-public__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-4);
    padding: var(--av-space-5) var(--av-space-6);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-public__foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-4);
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .av-public__foot a {
    color: inherit;
  }
}
@layer components {
  /* Page header ─────────────────────────────────────────────────────── */
  .av-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--av-space-4);
    margin-block-end: var(--av-space-6);
  }
  .av-page-header__title {
    font-size: var(--av-font-size-2xl);
    font-weight: var(--av-font-weight-bold);
    letter-spacing: -0.015em;
    margin: 0;
  }
  .av-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    list-style: none;
    margin: 0 0 var(--av-space-1);
    padding: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-breadcrumb a {
    color: inherit;
    text-decoration: none;
  }
  .av-breadcrumb a:hover {
    color: var(--av-text-secondary);
  }
  .av-breadcrumb li + li::before {
    content: "/";
    margin-inline-end: var(--av-space-2);
    color: var(--av-text-muted);
  }
  .av-page-header__subtitle {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    margin: var(--av-space-2) 0 0;
  }
  /* Wraps because a detail page can carry three actions and a narrow viewport
     would otherwise push the last one past the edge. */
  .av-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
}
@layer components {
  /* Split view ──────────────────────────────────────────────────────────
     The shared shell for every two- and three-pane application screen. Only
     the panes scroll; the shell itself never does, so the composer in chat and
     the list header in mail stay put. */
  .av-content--flush {
    overflow: hidden;
  }
  .av-main--app {
    overflow: hidden;
  }
  .av-split {
    display: grid;
    grid-template-columns: var(--av-split-list, 340px) 1fr;
    block-size: 100%;
    overflow: hidden;
  }
  .av-split--three {
    grid-template-columns: 220px var(--av-split-list, 340px) 1fr;
  }
  /* Browse-first layout: the middle pane is the content and the detail pane is
     a fixed-width inspector. Mail is the other way round — a fixed list beside
     a flexible reading pane — so this is a modifier rather than a variable.
     (Setting --av-split-list on a *child* cannot work: the template is resolved
     on the grid container, and custom properties only inherit downward.) */
  .av-split--inspector {
    grid-template-columns: 220px minmax(0, 1fr) var(--av-split-detail, 320px);
  }
  .av-split__nav,
  .av-split__list,
  .av-split__detail {
    overflow-y: auto;
    /* Without this a long unbroken subject line in the list widens the track
       and pushes the detail pane off-screen. */
    min-inline-size: 0;
  }
  .av-split__nav,
  .av-split__list {
    border-inline-end: 1px solid var(--av-border-subtle);
  }
  .av-split__nav {
    padding: var(--av-space-4);
  }
  .av-split__list-header {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-sticky);
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-3);
    background: var(--av-surface-raised);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-split__detail {
    background: var(--av-surface-raised);
  }
  /* The button that returns to the list on a single-pane viewport. */
  /* Shown only when the split has collapsed to one pane, because that is the
     only viewport where the list it goes back to is off screen.

     Scoped to `.av-split` for **specificity, not for meaning**: `.av-btn` also
     declares `display: inline-flex`, both rules are 0-1-0, both compile into
     `@layer components`, and `@use 'layout/split'` runs before
     `@use 'components/button'` — so source order handed the tie to the button
     and this rule never applied. The back button has been visible at every
     width on all five split pages, one dead tab stop beside a list that is
     already on screen. Nothing saw it: it renders, it is sized, it is
     reachable, and it does exactly what it says — it is simply answering a
     question the reader can see the answer to. The gotcha is recorded in
     `CLAUDE.md` — after a partial split, equal specificity resolves by `@use`
     order, so a rule that must win needs real specificity rather than a
     position. Both halves are scoped, or the media query loses the same tie. */
  .av-split .av-split__back {
    display: none;
  }
  @media (max-width: 991.98px) {
    .av-split--three {
      grid-template-columns: var(--av-split-list, 340px) 1fr;
    }
    .av-split--inspector {
      grid-template-columns: minmax(0, 1fr) var(--av-split-detail, 320px);
    }
    .av-split__nav {
      display: none;
    }
  }
  @media (max-width: 767.98px) {
    .av-split {
      grid-template-columns: 1fr;
    }
    .av-split__list {
      border-inline-end: 0;
    }
    .av-split__detail {
      display: none;
    }
    .av-split[data-av-split-view=detail] .av-split__list {
      display: none;
    }
    .av-split[data-av-split-view=detail] .av-split__detail {
      display: block;
    }
    /* Only ever shown here, so its gap from the block below it belongs in the
       same rule rather than in an inline `style=` on one page's button. */
    .av-split .av-split__back {
      display: inline-flex;
      margin-block-end: var(--av-space-3);
    }
  }
}
@layer components {
  /* ══ NAV LAYOUT AXIS ═══════════════════════════════════════════════════
     `data-av-layout` on <html>. One page tree, several arrangements, switched
     at runtime and persisted before first paint by the boot script — which has
     read and applied this key since it was written, against no CSS and no
     control. This partial is what finally gives it values.

     The competition ships each arrangement as a *separate demo folder* — ten
     copies of every page (`demo1/`, `demo2/`, …). That inflates a page count and
     strands a buyer inside whichever folder has the menu they wanted. Here the
     same markup answers to an attribute, so every layout works on every page,
     composes with every preset, both colour modes and RTL, and costs nothing
     per page.

     Rules for adding a value:
       1. Restructure with grid/flex only. Never hide content a layout needs —
          a menu item invisible in one arrangement is a broken page, not a style.
       2. Logical properties throughout: every value has to survive `dir="rtl"`.
       3. Nothing here may exceed 0-3-0, and no value may hard-code a colour —
          the sidebar's `--av-sidebar-*` slice already answers to the preset. */
  /* ── detached ─────────────────────────────────────────────────────────
     The rail floats as a card in its own gutter instead of butting against the
     viewport edge. Purely a shell treatment: the menu markup is untouched, so
     this composes with the collapsed rail and with `boxed` width for free. */
  [data-av-layout=detached] .av-shell {
    padding: var(--av-space-3);
    gap: var(--av-space-3);
  }
  [data-av-layout=detached] .av-sidebar {
    border-inline-end: 0;
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm);
  }
  [data-av-layout=detached] .av-main {
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-base);
    box-shadow: var(--av-shadow-sm);
    overflow: hidden; /* re-clip: the radius has to cut the topbar's corners */
  }
  /* ── rail ─────────────────────────────────────────────────────────────
     Icon-only rail that flies its labels out on hover or focus, rather than the
     `data-av-sidebar="collapsed"` rail which simply drops them. The distinction
     matters: an icon with no reachable name is a guess, and the flyout is what
     makes the narrow arrangement usable rather than merely narrow.

     The flyout is a hover/focus affordance with no JS, so it must not be the
     only route to the label — the collapsed rail keeps its `title`-free markup
     and the group headings stay in the accessibility tree. */
  [data-av-layout=rail] {
    --av-sidebar-current: var(--av-sidebar-width-rail, 68px);
  }
  [data-av-layout=rail] .av-sidebar {
    overflow: visible;
  }
  [data-av-layout=rail] .av-sidebar__nav {
    overflow: visible;
  }
  /* The collapse toggle drives `data-av-sidebar`, which in this layout would
     narrow an already-narrow rail to nothing — two controls for one width, and
     the second one only ever makes the navigation worse. */
  [data-av-layout=rail] .av-menu__title-text,
  [data-av-layout=rail] .av-menu__caret,
  [data-av-layout=rail] .av-brand__text,
  [data-av-layout=rail] .av-sidebar-collapse,
  [data-av-layout=rail] .av-sidebar__footer {
    display: none;
  }
  [data-av-layout=rail] .av-sidebar__brand {
    justify-content: center;
    padding-inline: 0;
  }
  /* A group heading with no text is a 26px band of nothing between two icons.
     The rule that hides the text cannot also collapse the row, because the
     <summary> is still the group's accessible name — so the row keeps its name
     and loses its box. */
  [data-av-layout=rail] .av-menu__title {
    padding-block: var(--av-space-1);
  }
  [data-av-layout=rail] .av-menu__link {
    justify-content: center;
    padding-inline: 0;
  }
  [data-av-layout=rail] .av-menu__item {
    position: relative;
  }
  /* The label rides out of the rail on the inline axis, so the travel carries
     its sign in a custom property the RTL rule below flips — `translate` has no
     logical form. Same contract as --av-drawer-from and --av-menu-sweep. */
  [data-av-layout=rail] .av-menu__label {
    --av-rail-flyout: var(--av-space-2);
    position: absolute;
    inset-inline-start: 100%;
    inset-block-start: 50%;
    z-index: var(--av-z-popover);
    margin-inline-start: var(--av-rail-flyout);
    padding: var(--av-space-1-5) var(--av-space-3);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    box-shadow: var(--av-shadow-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    translate: calc(var(--av-rail-flyout) * -1) -50%;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard), translate var(--av-duration-fast) var(--av-ease-standard);
  }
  /* `:active` is here for the finger. The label is the only place a rail row
     says what it is in words, and hover and focus-visible are both states a
     touchscreen has no way to enter — the rail stays a rail at every width, so
     a phone would get an icon-only navigation with no way to read any of it.
     Pressing and holding a row now shows the label, and lifting follows the
     link. The name itself was never at risk: the text is in the DOM and
     assistive technology has always read it. This is the sighted touch reader,
     who could see nine icons and learn nothing from them. */
  [data-av-layout=rail] .av-menu__link:hover .av-menu__label,
  [data-av-layout=rail] .av-menu__link:focus-visible .av-menu__label,
  [data-av-layout=rail] .av-menu__link:active .av-menu__label {
    opacity: 1;
    translate: 0 -50%;
  }
  [dir=rtl] [data-av-layout=rail] .av-menu__label,
  [data-av-layout=rail][dir=rtl] .av-menu__label {
    --av-rail-flyout: calc(var(--av-space-2) * -1);
  }
  /* ── horizontal ───────────────────────────────────────────────────────
     The rail becomes a menu bar across the top and every group heading becomes
     a dropdown trigger. The <details>/<summary> markup is not replaced — it is
     re-laid-out — so the platform keeps doing the keyboard model, the expanded
     state and the announcement, exactly as it does in the vertical rail. What
     JS adds (initNavBar) is only what a bar needs and a column does not: one
     panel open at a time, and close on outside click or Escape.

     `.av-shell` gives up `overflow: hidden` here rather than promoting each
     panel to the top layer. Both are valid answers to the containment trap in
     CLAUDE.md; this one is right for a bar because the panels are anchored to a
     row that never scrolls, so nothing can be clipped and no measurement is
     needed. The vertical rail keeps the clip, because its panels live inside a
     scrolling column where the top layer is the only correct answer. */
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "main";
    grid-template-rows: auto 1fr;
    overflow: visible;
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar {
    flex-direction: row;
    align-items: center;
    gap: var(--av-space-4);
    padding-inline: var(--av-space-4);
    border-inline-end: 0;
    border-block-end: 1px solid var(--av-sidebar-border);
    overflow: visible;
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar__brand {
    border-block-end: 0;
    padding-inline: 0;
    flex: none;
  }
  /* The collapse toggle drives a width this layout does not have. */
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar-collapse,
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar__footer {
    display: none;
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar__nav {
    flex: 1;
    min-inline-size: 0;
    padding: 0;
    overflow: visible;
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu {
    flex-direction: row;
    align-items: center;
    gap: var(--av-space-1);
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group {
    position: relative;
  }
  /* A bar heading is a control a visitor reads, not a section label they skim:
     it loses the all-caps micro-type the column uses. */
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__title {
    padding: var(--av-space-2) var(--av-space-3);
    font-size: var(--av-font-size-sm);
    letter-spacing: normal;
    text-transform: none;
    color: var(--av-sidebar-text);
    border-radius: var(--av-radius-md);
    white-space: nowrap;
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__title:hover {
    background: var(--av-sidebar-hover-bg);
    color: var(--av-sidebar-text-strong);
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__disclosure[open] > .av-menu__title {
    background: var(--av-sidebar-active-bg);
    color: var(--av-sidebar-text-strong);
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group-list {
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: 0;
    z-index: var(--av-z-popover);
    min-inline-size: 240px;
    max-block-size: min(70vh, 520px);
    overflow-y: auto;
    margin-block-start: var(--av-space-1);
    padding: var(--av-space-2);
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-lg);
  }
  /* The panel sits on a page surface, not on the rail, so its rows answer to the
     page ink. Without this a preset with an ink rail paints white-on-white. */
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group-list .av-menu__link {
    color: var(--av-text-secondary);
  }
  :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group-list .av-menu__link:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  /* ...and the active row has to answer to the page ink *as a pair*. The rule
     above re-points only `color`, at 0-3-0, so it beat the 0-2-0 active rule
     for the ink while leaving that rule's `background-color` in place. With
     `data-av-nav-skin="ink"` on a light theme that is
     `--av-neutral-850` behind `--av-text-secondary`: dark grey on near-black.
     It reads correctly in dark mode only because `--av-text-secondary` is light
     there, which is why it survived — the fix for white-on-white created
     dark-on-dark one skin over.

     Both halves are set here from page tokens, so the pairing cannot come apart
     again. `:where()` on the layout guard keeps this at 0-3-0, the ceiling
     `lint:css` enforces; it therefore ties with the rule above and wins on
     source order, which is safe only because the two are adjacent in one
     partial — do not separate them. */
  :where([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group-list .av-menu__item--active > .av-menu__link {
    background-color: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  /* A group near the inline end would push its panel past the viewport; the flag
     is set by initNavBar after measuring, never guessed from the item's index. */
  /* `:where()` on the two ancestors keeps the layout guard readable while
     contributing nothing, so the whole selector is 0-3-0 — one step above the
     0-2-0 base rule it has to beat, and exactly at the ceiling rather than over
     it. Written plainly it is 0-4-0 and `lint:css` refuses it, correctly: a rule
     that outranks everything is a rule nothing can override later. */
  :where([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group[data-av-nav-flip] > :where(.av-menu__disclosure) > .av-menu__group-list {
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
  /* ── mega ─────────────────────────────────────────────────────────────
     The same bar as `horizontal` — every rule above serves both — with one
     difference: the panel spans the bar instead of hanging under its trigger,
     and lays its items out in columns. That is the whole delta, which is why it
     shares the chrome through `:is()` rather than restating twenty rules. A
     second copy of the bar is a second thing to keep in step, and this file has
     to hold ten arrangements before it is finished.

     Full-width means the panel's containing block has to be the bar, not the
     group: `.av-menu__group` gives up `position: relative` here and the sidebar
     takes it. `initNavBar` never sets `data-av-nav-flip` in this layout — a
     panel already spanning the bar has no edge to run past. */
  [data-av-layout=mega] .av-sidebar {
    position: relative;
  }
  [data-av-layout=mega] .av-menu__group {
    position: static;
  }
  /* `_sidebar.scss` shows an open panel with
     `.av-menu__disclosure[open] > .av-menu__group-list { display: flex }`, which
     is **0-3-0 — the ceiling**. A layout that wants a different `display` cannot
     out-specify it and must not try: the only legal way past is to match it
     exactly and win on source order, which this partial does because it is
     `@use`d last. `:where()` carries the layout guard at zero cost to keep the
     total at 0-3-0 rather than 0-4-0.

     Worth knowing before adding the next arrangement: the 0-2-0 block below
     applied every property *except* `display`, so the panel was a full-width
     flex column and looked merely ugly rather than broken. A partially-applied
     rule is the failure mode to expect here. */
  :where([data-av-layout=mega]) .av-menu__disclosure[open] > .av-menu__group-list {
    display: grid;
  }
  /* A divider separates two stacked groups in the rail, where "the rule between
     them" is a real relationship. In the mega panel the list is a grid, so the
     `<li>` takes a whole 210px cell and reads as a stray line beside an empty
     label — a broken row rather than a grouping. It carries `aria-hidden`, so
     nothing is lost by dropping it; the grouping it implied does not survive
     the change of axis. Both menu dividers rendered this way. */
  /* A divider separates two stacked groups in the rail, where "the rule between
     them" is a real relationship. In the mega panel the list is a grid, so the
     `<li>` takes a whole 210px cell and reads as a stray line beside an empty
     label — a broken row rather than a grouping. It carries `aria-hidden`, so
     nothing is lost by dropping it; the grouping it implied does not survive
     the change of axis. Both menu dividers rendered this way. */
  [data-av-layout=mega] .av-menu__divider {
    display: none;
  }
  [data-av-layout=mega] .av-menu__group-list {
    inset-inline: 0;
    min-inline-size: 0;
    /* auto-fill, not auto-fit: a group with three items should keep three
       column-widths and leave the rest empty, rather than stretching three
       items across the full width of the window. */
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: var(--av-space-1) var(--av-space-4);
    padding: var(--av-space-4);
  }
  /* ── stacked ──────────────────────────────────────────────────────────
     The dual-row header: utilities on top, navigation beneath, content below
     that. This is the one arrangement the DOM order cannot express directly —
     the topbar is a child of `.av-main`, and the nav has to sit *between* it and
     the content, so no amount of `grid-area` on `.av-shell` can interleave them.

     `display: contents` on `.av-main` is the answer, and it is worth stating why
     it is the right one rather than the clever one: the alternative is moving
     nodes at runtime, which would make this the only layout whose markup differs
     — the axis would stop being "the same page tree, rearranged" and start being
     a DOM rewrite that a framework integration has to know about. Dissolving one
     box keeps the contract.

     What that box was doing has to be paid for, though. `.av-main` carried
     `min-inline-size: 0` — the guard that stops a wide table shoving the layout
     past the viewport — and its own `overflow: hidden`. Its children become grid
     items of `.av-shell` with `min-width: auto`, so the guard is restated on the
     item that can actually hold a table. */
  [data-av-layout=stacked] .av-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "topbar" "sidebar" "content" "footer";
    overflow: visible;
  }
  [data-av-layout=stacked] .av-main {
    display: contents;
  }
  [data-av-layout=stacked] .av-content {
    min-inline-size: 0;
  }
  [data-av-layout=stacked] .av-sidebar {
    flex-direction: row;
    align-items: center;
    gap: var(--av-space-4);
    padding-inline: var(--av-space-4);
    border-inline-end: 0;
    border-block: 1px solid var(--av-sidebar-border);
    overflow: visible;
  }
  /* The brand stays. The first version hid it on the assumption that the row
     above carried one — the topbar does not, and never has, so the product name
     vanished from every page in this layout. Nothing in the topbar names the
     application; the rail was the only place it appeared.

     The nav row also takes the sunken surface, and that is doing real work
     rather than decoration: without it `stacked` is `horizontal` with its two
     rows swapped, which is the kind of near-duplicate that pads a competitor's
     demo count. Tinting the row makes it read as a secondary bar beneath a
     primary one — a different thing, not a reordered one. */
  [data-av-layout=stacked] .av-sidebar {
    background: var(--av-surface-sunken);
    min-block-size: 0;
  }
  [data-av-layout=stacked] .av-sidebar__footer {
    display: none;
  }
  [data-av-layout=stacked] .av-sidebar__brand {
    min-block-size: 0;
  }
  [data-av-layout=stacked] .av-sidebar__nav {
    flex: 1;
    min-inline-size: 0;
    padding: 0;
    overflow: visible;
  }
  /* ── two-column ───────────────────────────────────────────────────────
     A master column of section names beside a detail column of that section's
     items. Metronic's equivalent puts *icons* in the master column, and this
     one deliberately does not: our group headings are text, so matching that
     would mean adding a hidden `<svg>` to all seven `<summary>` elements on all
     88 pages to serve one arrangement — real weight carried by five layouts
     that never show it. Section names read better than seven glyphs nobody has
     a legend for, and cost nothing.

     Exactly one section is open at all times here, which is the difference from
     a bar: the detail column is permanent chrome, not an overlay, so there is no
     empty state to fall into and nothing for Escape or an outside click to
     dismiss. `initNavBar` enforces that; see COLUMN_LAYOUTS. */
  [data-av-layout=two-column] {
    --av-nav-master: 132px;
    --av-sidebar-current: var(--av-sidebar-width-two-column, 336px);
  }
  [data-av-layout=two-column] .av-sidebar__nav {
    position: relative;
    display: grid;
    grid-template-columns: var(--av-nav-master) 1fr;
    padding: 0;
    overflow: hidden;
  }
  [data-av-layout=two-column] .av-menu {
    grid-column: 1;
    overflow-y: auto;
    padding: var(--av-space-3) var(--av-space-2);
    border-inline-end: 1px solid var(--av-sidebar-border);
  }
  /* The heading stops being a label and becomes the master column's row, so it
     takes the same shape as a menu link rather than the micro-caps of a section
     divider — it is the thing being chosen from now. */
  [data-av-layout=two-column] .av-menu__title {
    padding: var(--av-space-2) var(--av-space-3);
    font-size: var(--av-font-size-sm);
    letter-spacing: normal;
    text-transform: none;
    color: var(--av-sidebar-text);
    border-radius: var(--av-radius-md);
  }
  [data-av-layout=two-column] .av-menu__disclosure[open] > .av-menu__title {
    background: var(--av-sidebar-active-bg);
    color: var(--av-sidebar-text-strong);
  }
  [data-av-layout=two-column] .av-menu__caret {
    display: none;
  }
  [data-av-layout=two-column] .av-menu__group-list {
    position: absolute;
    inset-block: 0;
    inset-inline: var(--av-nav-master) 0;
    overflow-y: auto;
    padding: var(--av-space-3);
  }
  /* ── floating ─────────────────────────────────────────────────────────
     `horizontal`'s bar, lifted off the edges into its own gutter — the same
     treatment `detached` gives the vertical rail, which is why neither one
     restates the other's rules: `detached` frames a column, this frames a bar. */
  [data-av-layout=floating] .av-shell {
    padding: var(--av-space-3);
    gap: var(--av-space-3);
  }
  [data-av-layout=floating] .av-sidebar {
    border-block-end: 0;
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm);
  }
  [data-av-layout=floating] .av-main {
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-base);
    box-shadow: var(--av-shadow-sm);
    overflow: hidden;
  }
  /* The bar no longer reaches the viewport edge, so a panel pinned to the bar's
     start is inset by the gutter — which is correct, and why the flip
     measurement is a measurement rather than a guess about the window. */
  [data-av-layout=floating] .av-menu__group-list {
    margin-block-start: var(--av-space-2);
  }
  /* ── bottom ───────────────────────────────────────────────────────────
     The bar docks to the bottom edge: content first, navigation last. Worth its
     place rather than padding because it inverts something no other value does
     — the panels have to open **upward**, which is a different rule and not a
     different skin. Touch dashboards and kiosk screens are where this earns its
     keep: the nav sits under the thumb rather than at arm's reach. */
  [data-av-layout=bottom] .av-shell {
    grid-template-areas: "main" "sidebar";
    grid-template-rows: 1fr auto;
  }
  [data-av-layout=bottom] .av-sidebar {
    border-block-end: 0;
    border-block-start: 1px solid var(--av-sidebar-border);
  }
  [data-av-layout=bottom] .av-menu__group-list {
    inset-block-start: auto;
    inset-block-end: 100%;
    margin-block: 0 var(--av-space-1);
  }
  /* ── overlay ──────────────────────────────────────────────────────────
     No persistent navigation at any width: the rail is off-canvas until asked
     for, and the content gets the whole window. This is the arrangement the
     product already had — `_sidebar.scss` builds it below 992px — promoted from
     a breakpoint to a choice. `initShell` routes the toggle here at every width
     rather than only on small screens.

     `translate` has no logical form, so the travel carries its sign in a custom
     property the RTL rule flips — the `directional-transform` contract, same as
     `--av-drawer-from` and `--av-rail-flyout`. */
  [data-av-layout=overlay] .av-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
  [data-av-layout=overlay] .av-sidebar {
    --av-overlay-from: -100%;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: var(--av-sidebar-width);
    translate: var(--av-overlay-from) 0;
    transition: translate var(--av-duration-normal) var(--av-ease-emphasized);
    box-shadow: var(--av-shadow-xl);
  }
  [dir=rtl] [data-av-layout=overlay] .av-sidebar,
  [data-av-layout=overlay][dir=rtl] .av-sidebar {
    --av-overlay-from: 100%;
  }
  [data-av-layout=overlay] .av-sidebar.is-mobile-open {
    translate: 0 0;
  }
  /* Without this the layout has **no way in at all** on desktop, and it was
     written that way first: `_sidebar.scss` hides the topbar hamburger above
     992px because every other arrangement keeps its rail on screen, and the
     rail's own collapse button is off-canvas here along with the rail. Two
     controls, both unreachable, and the navigation simply gone. `tests/
     nav-layouts.mjs` failed on the click that could not land, which is the
     assertion earning its place — a screenshot of this layout looks fine.

     0-3-0 to clear the 0-2-0 rule that hides it; that rule is itself scoped
     rather than bare for the reason its own comment gives. */
  [data-av-layout=overlay] .av-topbar .av-topbar__menu-btn {
    display: inline-flex;
  }
  /* Below the sidebar breakpoint every arrangement falls back to the off-canvas
     column, which is the only one that fits. `_sidebar.scss` already states
     that for the whole product, at 0-1-0 — so this block must *undo* what each
     layout changed above and nothing more.

     Restating the shell grid here instead is what the first version did, and
     because these selectors are 0-2-0 they beat the base rule and re-added a
     sidebar column at every mobile width: `tests/nav-layouts.mjs` caught it as
     a 62px document overflow at 320px on three of four layouts. The pattern to
     copy is the collapsed-sidebar reset further down `_sidebar.scss`, which
     reverts named properties rather than re-solving the layout. */
  @media (max-width: 991.98px) {
    [data-av-layout=detached] .av-shell {
      padding: 0;
      gap: 0;
    }
    [data-av-layout=detached] .av-sidebar,
    [data-av-layout=detached] .av-main {
      border-radius: 0;
      box-shadow: none;
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-shell {
      grid-template-columns: 1fr;
      grid-template-areas: "main";
      grid-template-rows: auto;
      overflow: hidden;
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding-inline: 0;
      overflow: hidden;
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar__brand {
      padding-inline: var(--av-space-4);
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar__nav {
      padding: var(--av-space-3);
      overflow-y: auto;
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-sidebar__footer {
      display: revert;
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu {
      flex-direction: column;
      align-items: stretch;
    }
    :is([data-av-layout=horizontal], [data-av-layout=mega], [data-av-layout=stacked], [data-av-layout=floating], [data-av-layout=bottom]) .av-menu__group-list {
      position: static;
      min-inline-size: 0;
      margin-block-start: 0;
      padding: 0;
      background: none;
      border: 0;
      border-radius: 0;
      box-shadow: none;
      max-block-size: none;
      overflow: visible;
    }
    /* The rail is a desktop arrangement; off-canvas it is the ordinary column,
       labels and all — the same call `[data-av-sidebar="collapsed"]` makes. */
    [data-av-layout=stacked] .av-main {
      display: grid;
    }
    [data-av-layout=stacked] .av-sidebar__brand {
      display: flex;
    }
    /* Two columns do not fit in an off-canvas drawer; it is the ordinary
       column here, and `initNavBar` stops enforcing one-open with it. */
    [data-av-layout=two-column] {
      --av-sidebar-current: var(--av-sidebar-width);
    }
    [data-av-layout=two-column] .av-sidebar__nav {
      display: block;
      padding: var(--av-space-3);
      overflow-y: auto;
    }
    [data-av-layout=two-column] .av-menu {
      border-inline-end: 0;
      padding: 0;
      overflow: visible;
    }
    [data-av-layout=two-column] .av-menu__group-list {
      position: static;
      padding: 0;
      overflow: visible;
    }
    [data-av-layout=two-column] .av-menu__caret {
      display: block;
    }
    [data-av-layout=rail] {
      --av-sidebar-current: var(--av-sidebar-width);
    }
    [data-av-layout=rail] .av-menu__title-text,
    [data-av-layout=rail] .av-menu__caret,
    [data-av-layout=rail] .av-brand__text,
    [data-av-layout=rail] .av-sidebar-collapse,
    [data-av-layout=rail] .av-sidebar__footer {
      display: revert;
    }
    [data-av-layout=rail] .av-sidebar__brand {
      justify-content: space-between;
      padding-inline: var(--av-space-4);
    }
    [data-av-layout=rail] .av-menu__link {
      justify-content: flex-start;
      padding-inline: var(--av-space-3);
    }
    /* The flyout is a hover affordance with no room to fly out to. */
    [data-av-layout=rail] .av-menu__label {
      position: static;
      z-index: auto;
      margin-inline-start: 0;
      padding: 0;
      background: none;
      border: 0;
      box-shadow: none;
      opacity: 1;
      pointer-events: auto;
      translate: none;
    }
  }
}
@layer components {
  /* Buttons ─────────────────────────────────────────────────────────── */
  .av-btn {
    --av-btn-height: var(--av-control-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--av-space-2);
    min-block-size: var(--av-btn-height);
    padding-inline: var(--av-space-6);
    border: 1px solid transparent;
    border-radius: var(--av-radius-md);
    font-family: var(--av-font-sans);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard), transform var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-btn:active {
    transform: translateY(1px);
  }
  /* The fill and its ink travel as a pair of variables rather than being read
     straight off the semantics, so a subtree can re-point them without restating
     the gradient recipe. The sidebar does exactly that: on a preset with an ink
     rail, a primary button painted in an ink primary disappears into it. */
  .av-btn--primary {
    --av-btn-fill: var(--av-color-primary);
    --av-btn-fill-hover: var(--av-color-primary-hover);
    --av-btn-ink: var(--av-text-on-primary);
    background: linear-gradient(180deg, color-mix(in oklch, var(--av-btn-fill) 88%, white) 0%, var(--av-btn-fill) 45%, color-mix(in oklch, var(--av-btn-fill) 90%, black) 100%);
    color: var(--av-btn-ink);
    box-shadow: 0 1px 2px oklch(var(--av-shadow-color)/0.25), inset 0 1px 0 oklch(var(--av-highlight-color)/0.15);
  }
  /* The sheen is a pseudo element rather than a background layer so hovering can
     fade it independently of the gradient underneath. Swapping `background` on
     hover — as this rule used to — replaced the gradient with a flat fill and
     the button visibly lost its dimension at the moment it was pointed at. */
  .av-btn--primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .av-btn--primary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: var(--av-z-below);
    background: var(--av-gradient-sheen);
    opacity: 0;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-btn--primary:hover {
    background-image: linear-gradient(180deg, color-mix(in oklch, var(--av-btn-fill-hover) 88%, white) 0%, var(--av-btn-fill-hover) 45%, color-mix(in oklch, var(--av-btn-fill-hover) 90%, black) 100%);
    box-shadow: 0 4px 14px -4px color-mix(in oklch, var(--av-btn-fill) 60%, transparent), inset 0 1px 0 oklch(var(--av-highlight-color)/0.12);
  }
  .av-btn--primary:hover::after {
    opacity: 1;
  }
  .av-btn--primary:active {
    background-image: none;
    background-color: var(--av-color-primary-active);
  }
  [data-av-preset=grape] .av-btn--primary {
    background-image: linear-gradient(135deg, var(--av-primary-500), var(--av-accent-500));
  }
  [data-av-preset=grape] .av-btn--primary:hover {
    background-image: linear-gradient(135deg, var(--av-primary-600), var(--av-accent-500));
  }
  .av-btn--outline {
    background: transparent;
    border-color: var(--av-border-default);
    color: var(--av-text-secondary);
  }
  .av-btn--outline:hover {
    border-color: var(--av-border-strong);
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-btn--ghost {
    background: transparent;
    color: var(--av-text-secondary);
  }
  .av-btn--ghost:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  /* Quiet sits between ghost and outline, and it exists for one place: a
     control inside a table row.

     A ghost button is invisible until the pointer is over it, which is fine
     for a card header — there is one of them, in a place the reader has
     already looked. In a row it is a word in a cell. `Rotate`, `Revoke`,
     `Reveal` and `Copy` sat in a table reading as plain text beside real text,
     and the only thing that ever said otherwise was a hover a keyboard user
     never produces and a touch user cannot.

     Outline is the wrong answer in the other direction: eight rows of bordered
     buttons is a wall of boxes competing with the data. This is the hairline
     version — a subtle border and nothing else at rest, the same hover as
     outline. The affordance is present without the row becoming a toolbar. */
  .av-btn--quiet {
    background: transparent;
    border-color: var(--av-border-subtle);
    color: var(--av-text-secondary);
  }
  .av-btn--quiet:hover {
    border-color: var(--av-border-default);
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-btn--quiet.is-loading::before {
    color: var(--av-text-secondary);
  }
  /* On-media sits over a photograph, and that is the whole reason it exists.

     A ghost button's contrast is only defined against a *known* surface. The
     quick actions on a product card sit on top of an arbitrary product
     photograph, so the same button is a dark stroke on a pale desk and
     invisible on a dark one — no token can promise anything about a pixel the
     customer supplied. This is `.av-btn--quiet`'s argument one component
     along: a control the reader is meant to find must not depend on the
     hover it has not performed yet, and here it must not depend on the
     picture either.

     Glass is the tempting answer and it is wrong for exactly the same reason:
     `--av-glass-bg` blurs what is behind it, so the photograph's luminance
     still drives the result and a busy image still eats the icon. This is an
     opaque `--av-surface-raised` disc — the card's own surface, lifted onto
     the media — which puts the ink back on a surface the contrast tokens
     actually describe, and re-themes across every preset and both modes for
     free. The shadow is what separates it from a pale photograph, where a
     border alone would vanish. */
  .av-btn--on-media {
    background: var(--av-surface-raised);
    border-color: var(--av-border-subtle);
    color: var(--av-text-secondary);
    box-shadow: var(--av-shadow-sm);
  }
  .av-btn--on-media:hover {
    background: var(--av-surface-raised);
    border-color: var(--av-border-strong);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-md);
  }
  .av-btn--on-media.is-loading::before {
    color: var(--av-text-secondary);
  }
  .av-btn--pill {
    border-radius: var(--av-radius-full);
  }
  .av-btn--block {
    inline-size: 100%;
  }
  .av-btn--lg {
    --av-btn-height: var(--av-control-lg);
    font-size: var(--av-font-size-base);
  }
  .av-btn--icon {
    inline-size: var(--av-btn-height);
    padding-inline: 0;
    border-radius: var(--av-radius-full);
  }
  /* The size modifiers set `padding-inline` and sit later in this same layer, so
     at equal specificity they take it back from --icon: a 32px button ends up
     with 24px of padding and squashes its icon to 6px. Give the combination
     specificity rather than depending on the order of two rules in one file. */
  .av-btn--icon.av-btn--sm,
  .av-btn--icon.av-btn--lg {
    padding-inline: 0;
  }
  .av-btn--sm {
    --av-btn-height: var(--av-control-sm);
    font-size: var(--av-font-size-xs);
    padding-inline: var(--av-space-3);
  }
  .av-btn--soft-primary {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-btn--soft-success {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-btn--soft-warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
  }
  .av-btn--soft-danger {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-btn--soft-info {
    background: var(--av-color-info-subtle);
    color: var(--av-color-info-text);
  }
  [class*=av-btn--soft-]:hover {
    filter: brightness(0.96);
  }
  [data-bs-theme=dark] [class*=av-btn--soft-]:hover {
    filter: brightness(1.25);
  }
  /* `--av-text-on-danger`, never a literal white. The build computes each role's ink
     against that role's own fill, per preset and per mode — which is the whole point of
     the token, and this rule was bypassing it. In dark mode the fill is light enough that
     white measured 3.79:1 while the computed near-black measured 4.32:1: the hard-coded
     value was not merely inconsistent, it was the worse of the two available inks. It is
     the same defect `--av-text-on-warning` exists to prevent, where amber cannot carry
     white at all. */
  .av-btn--danger {
    background: var(--av-color-danger);
    color: var(--av-text-on-danger);
  }
  .av-btn--danger:hover {
    background: var(--av-color-danger-hover);
  }
  .av-btn--outline-danger {
    background: transparent;
    border-color: var(--av-color-danger-border);
    color: var(--av-color-danger-text);
  }
  .av-btn--outline-danger:hover {
    background: var(--av-color-danger-subtle);
  }
  .av-btn:disabled, .av-btn[aria-disabled=true] {
    opacity: 0.55;
    pointer-events: none;
  }
  /* The spinner lives on `::before`, and which pseudo-element it uses is the
     entire defect rather than a detail. `.av-btn--primary::after` is already
     the hover sheen: `inset: 0`, `opacity: 0`, `z-index: var(--av-z-below)`.
     A spinner written on that same pseudo-element inherits all three, because
     specificity only arbitrates a property *both* rules declare — and the
     sheen declares three the spinner never mentions. So the spinner was
     rendered, sized, and animating, while being fully transparent, painted
     behind the gradient, and pinned to the top-left corner by an `inset` it
     never asked for. Every primary button in the product — which is every
     `data-av-loading` button but one — went blank the moment it was pressed:
     no label, no spinner, a filled slab with a toast appearing beside it.
     `::before` is used by nothing else in the stylesheet, so it is the
     spinner's outright rather than shared.

     The comment this replaces argued that 0-2-0 "already beats every variant
     rule". That was true and beside the point: the properties it lost were
     never contested. */
  .av-btn.is-loading {
    pointer-events: none;
    position: relative;
  }
  .av-btn.is-loading::before {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    margin-block-start: -8px;
    margin-inline-start: -8px;
    inline-size: 16px;
    block-size: 16px;
    border: 2px solid currentColor;
    border-block-start-color: transparent;
    border-radius: var(--av-radius-full);
    color: var(--av-text-on-primary);
    animation: av-btn-spin 700ms linear infinite;
  }
  /* Named for this component rather than borrowed. `av-spin` is declared in
     `components/_customizer.scss` and was the stylesheet's only cross-partial
     keyframe dependency: a build that dropped the customizer would leave every
     button spinner frozen mid-arc, with nothing failing and nothing to grep. */
  @keyframes av-btn-spin {
    to {
      rotate: 360deg;
    }
  }
  /* With no loading text the label is hidden behind the spinner rather than
     removed, so the button keeps its width. `:not()` rather than restoring the
     colour afterwards: `color: inherit` would take the page's text colour, not
     the variant's own, and paint dark ink on a dark fill. */
  .av-btn.is-loading:not([data-av-loading-mode=replace]) {
    color: transparent;
  }
  /* `data-av-loading-text` swaps the label for a progress message, so the label
     has to stay visible and the spinner has to sit beside it rather than over
     it. Returning `position` to static makes the pseudo-element a flex item of
     the button, which inherits the button's own `gap` — no second set of
     spacing rules — and it lands ahead of the text because `::before` does. */
  .av-btn.is-loading[data-av-loading-mode=replace]::before {
    position: static;
    margin: 0;
    flex: none;
  }
  .av-btn--outline.is-loading::before, .av-btn--ghost.is-loading::before {
    color: var(--av-text-secondary);
  }
  /* Every variant that is *not* a solid fill needs its own spinner ink, because
     the default is `--av-text-on-primary` — white in most themes, and a white
     arc on a `-subtle` tint or a transparent ground is the same invisible
     spinner this whole block was written to fix, one variant family along. No
     shipped markup puts `data-av-loading` on one of these yet, which is exactly
     why it would have gone unnoticed. `currentColor` cannot serve here: the
     button's own colour is `transparent` while the label is hidden behind the
     spinner. */
  .av-btn--soft-primary.is-loading::before {
    color: var(--av-color-primary-text);
  }
  .av-btn--soft-success.is-loading::before {
    color: var(--av-color-success-text);
  }
  .av-btn--soft-warning.is-loading::before {
    color: var(--av-color-warning-text);
  }
  .av-btn--soft-danger.is-loading::before {
    color: var(--av-color-danger-text);
  }
  .av-btn--soft-info.is-loading::before {
    color: var(--av-color-info-text);
  }
  .av-btn--outline-danger.is-loading::before {
    color: var(--av-color-danger-text);
  }
}
@layer components {
  /* `.av-icon` styles every glyph in the product — 1,313 of them — and lived in
     `_button.scss` because a button needed it first. That is the placement debt
     this codebase has corrected three times already (`.av-section` out of
     `_example.scss`, `.av-avatar` out of the topbar, `.av-table__link` out of
     `.av-table__customer-name`), and the house rule is explicit about it: never
     leave a component named or filed after the first screen that needed it.

     The size is one custom property with a fallback rather than two declarations
     repeated per step. That matters for the contextual rules: a component that
     dictates its own icon size writes `--av-icon-size` and inherits everything
     else, so there is no specificity contest and one writer for the value.

     Presentation is owned here, not by the markup: the glyphs are emitted by
     `build-html.mjs` with their attributes stripped, so `stroke-width` is this
     rule's decision and changing it changes every icon at once. */
  .av-icon {
    inline-size: var(--av-icon-size, 20px);
    block-size: var(--av-icon-size, 20px);
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  /* Five steps, and they replace sixteen sizes that had accumulated across
     twenty partials — 11, 12, 13, 14, 15, 16, 17, 18, 22, 26, 30, 34 and 72px,
     plus four written inline. Eight of those sat within 8px of each other, which
     is not a scale but the residue of twenty decisions nobody compared.

     A step is chosen by an author in markup (`{{ icon trash lg }}`); a component
     that always sizes its own icons sets `--av-icon-size` in its own partial
     instead, so the author does not have to remember. */
  .av-icon--xs {
    --av-icon-size: 12px;
  }
  .av-icon--sm {
    --av-icon-size: 16px;
  }
  .av-icon--lg {
    --av-icon-size: 26px;
  }
  .av-icon--xl {
    --av-icon-size: 34px;
  }
  .av-icon--2xl {
    --av-icon-size: 72px;
  }
  /* A filled glyph is a *state*, not a size — the rated star against the empty
     one. It was written as `fill="currentColor"` straight on nine `<svg>`s in
     reviews.html, beside an `av-icon--empty` class doing the opposite job: one
     component, two mechanisms, and only one of them visible to a gate. */
  .av-icon--filled {
    fill: currentColor;
  }
}
@layer components {
  /* Underline fields (auth style) ───────────────────────────────────── */
  .av-field-line {
    display: block;
    margin-block-end: var(--av-space-6);
  }
  .av-field-line__label {
    display: block;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    letter-spacing: var(--av-tracking-wide);
    color: var(--av-text-muted);
    margin-block-end: var(--av-space-1);
    transition: color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-field-line__control {
    position: relative;
    display: flex;
    align-items: center;
    border-block-end: 1.5px solid var(--av-border-default);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-field-line__control::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -1.5px;
    block-size: 2px;
    background: linear-gradient(90deg, var(--av-color-primary), var(--av-accent-500));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-field-line:focus-within .av-field-line__control::after {
    transform: scaleX(1);
  }
  .av-field-line:focus-within .av-field-line__label {
    color: var(--av-color-primary);
  }
  .av-field-line__input {
    flex: 1 1 auto;
    min-inline-size: 0;
    background: transparent;
    border: 0;
    padding-block: var(--av-space-2-5);
    padding-inline: 0;
    color: var(--av-text-primary);
    font-size: var(--av-font-size-base);
  }
  .av-field-line__input::placeholder {
    color: var(--av-text-muted);
  }
  /* Edge ships its own reveal control; we provide an accessible one with aria-pressed. */
  .av-field-line__input::-ms-reveal,
  .av-field-line__input::-ms-clear {
    display: none;
  }
  .av-field-line__input:focus {
    outline: none;
  }
  .av-field-line__input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--av-surface-raised) inset;
    -webkit-text-fill-color: var(--av-text-primary);
  }
  .av-field-line__icon {
    color: var(--av-text-muted);
    display: grid;
    place-items: center;
    padding-inline-start: var(--av-space-2);
  }
  .av-field-line__toggle {
    background: none;
    border: 0;
    color: var(--av-text-muted);
    display: grid;
    place-items: center;
    padding: var(--av-space-1);
    margin-inline-start: var(--av-space-1);
    border-radius: var(--av-radius-sm);
    transition: color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-field-line__toggle:hover {
    color: var(--av-text-secondary);
  }
  .av-field-line__toggle .av-icon--off {
    display: none;
  }
  .av-field-line__toggle[aria-pressed=true] .av-icon--on {
    display: none;
  }
  .av-field-line__toggle[aria-pressed=true] .av-icon--off {
    display: block;
  }
  .av-field-line__hint {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: var(--av-space-1-5);
  }
  /* `.av-check` and `.av-form-check` moved to `components/_check.scss`. They were
     here because the auth card needed a "remember me" first, which is the same
     accident that had `.av-avatar` living in the topbar partial. */
  /* Switch */
  .av-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-3);
    cursor: pointer;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  /* The label is the target — it wraps the input, so tapping the word toggles
     the switch — and at 20px the whole row was under the touch minimum. The
     *row* grows, not the track: the thumb is pinned 2px from the track's top
     edge, so a taller track would leave a 16px knob sitting high in a 24px
     pill. `align-items: center` was already there and does the rest. */
  @media (pointer: coarse) {
    .av-switch {
      min-block-size: var(--av-size-touch-min);
    }
  }
  .av-switch input {
    appearance: none;
    inline-size: 36px;
    block-size: 20px;
    flex: none;
    border-radius: var(--av-radius-full);
    background: var(--av-border-default);
    position: relative;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-switch input::before {
    content: "";
    position: absolute;
    inset-block-start: 2px;
    inset-inline-start: 2px;
    inline-size: 16px;
    block-size: 16px;
    border-radius: var(--av-radius-full);
    background: var(--av-neutral-0);
    box-shadow: var(--av-shadow-sm);
    transition: translate var(--av-duration-fast) var(--av-ease-emphasized);
  }
  .av-switch input:checked {
    background: var(--av-color-primary);
  }
  /* `translate` has no logical form, so a bare `16px` moves the knob to the
     physical right in both directions — and in RTL the track's off position is
     already the right, so switching one on slid the knob *out of its own pill*.
     Three of them sat like that on the appearance screen, which is the screen
     that offers the right-to-left switch in the first place.

     Same tactic as the drawer's `--av-drawer-from`, the sidebar's sweep and the
     section chevron: carry the direction in a custom property and let the
     `[dir]` rule flip that one value. The travel matches the geometry above —
     36px track less a 16px knob less 2px of inset at each end. */
  .av-switch input {
    --av-switch-travel: 16px;
  }
  [dir=rtl] .av-switch input {
    --av-switch-travel: -16px;
  }
  .av-switch input:checked::before {
    translate: var(--av-switch-travel) 0;
  }
  /* Divider with label */
  .av-divider {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-xs);
    letter-spacing: var(--av-tracking-wider);
    text-transform: uppercase;
    margin-block: var(--av-space-6);
  }
  .av-divider::before, .av-divider::after {
    content: "";
    flex: 1;
    block-size: 1px;
    background: var(--av-border-subtle);
  }
  /* A reassurance under a full-width button, centred to match it. It is a
     modifier rather than a rule keyed on following `.av-btn--block`, and the
     reason is measured: four elements in the product match that adjacency and
     the confirmation page's is deliberately left-aligned, so the sibling rule
     would have silently re-centred a fourth page nobody asked about. */
  .av-field-line__hint--center {
    text-align: center;
  }
}
@layer components {
  /* Checkbox and radio ───────────────────────────────────────────────────
     One painted control, for every checkbox and radio in the product.

     It used to be six partials each writing `accent-color: var(--av-color-primary)`
     over the browser's own control — the matrix, the datagrid select column, the
     facet list, the task list, the choice card and the field helper. That is not a
     design; it is a hue handed to the platform, and the platform draws it in the
     shape of whatever decade the operating system is from. Every other binary
     control here was already painted — `.av-switch` since it was written — so the
     product shipped a modern toggle beside a Windows 2000 tick box on the same
     screen. The permission matrix, which is ninety of them at once, is where that
     read as a broken page rather than as a small inconsistency.

     Three things about it are decisions rather than styling:

     - **The input is still the control.** `appearance: none` repaints the element
       itself; nothing is hidden and nothing is proxied by a sibling `<span>`. Focus
       lands on it, `:checked` and `:indeterminate` style it directly, a label still
       drives it, and a test that clicks it clicks a thing that is on the screen —
       the failure mode of the visually-hidden-input pattern is a control the
       keyboard can reach and a pointer cannot.
     - **The tick is a `clip-path`, not a glyph and not an SVG.** A character is
       announced by a screen reader and lands in a text copy of the row; an inline
       SVG would be one copy per cell — ninety on the roles page. `clip-path` on a
       block of `currentColor` is crisp at any size and inherits the ink, which is
       what lets the tick be `--av-text-on-primary`: the near-black-or-white
       decision the token generator already computes per preset per mode, so a
       light primary gets a dark tick instead of a white one nobody can see. It is
       deliberately *not* built from two rotated borders, the usual trick, because
       `border-inline-end` mirrors under `dir="rtl"` and would hand an RTL reader a
       backwards tick.
     - **`--av-check-size` is inherited, not a modifier.** The matrix wants 20px and
       the datagrid 16px; both set the custom property on an ancestor and every
       control below it follows. A `--sm`/`--lg` pair would have to be written onto
       each of the ninety inputs instead.

     The pseudo-element on a form control is the same idiom `.av-switch` has used
     since it was written; it renders because `appearance: none` takes the element
     out of the replaced-element path. */
  .av-check {
    --av-check-size: 18px;
    appearance: none;
    flex: none;
    position: relative;
    display: inline-block;
    inline-size: var(--av-check-size);
    block-size: var(--av-check-size);
    margin: 0;
    border: 1px solid var(--av-border-strong);
    border-radius: var(--av-radius-xs);
    background: var(--av-surface-raised);
    /* The tick's ink, read through `currentColor` by the pseudo-element. It is
       set here rather than on the checked rule so an unchecked box still has a
       sane inherited colour if anything else ever reads it. */
    color: var(--av-text-on-primary);
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  /* The mark. Six points: down-stroke, elbow, up-stroke, and the two end caps
     that give it thickness. Percentages, so one polygon serves 16px and 20px. */
  .av-check::before {
    content: "";
    position: absolute;
    inset: 0;
    background: currentColor;
    clip-path: polygon(20% 55%, 30% 45%, 43% 59%, 72% 25%, 82% 35%, 43% 77%);
    opacity: 0;
    scale: 0.4;
    transition: opacity var(--av-duration-fastest) var(--av-ease-standard), scale var(--av-duration-fast) var(--av-ease-spring);
  }
  /* A radio is the same control with a round box and a dot for a mark. Keyed off
     the type attribute rather than a modifier class, so an author cannot put the
     tick polygon inside a circle by forgetting one. */
  .av-check[type=radio] {
    border-radius: var(--av-radius-full);
  }
  .av-check[type=radio]::before {
    clip-path: none;
    inset: 25%;
    border-radius: var(--av-radius-full);
  }
  .av-check:checked,
  .av-check:indeterminate {
    background: var(--av-color-primary);
    border-color: var(--av-color-primary);
  }
  .av-check:checked::before,
  .av-check:indeterminate::before {
    opacity: 1;
    scale: 1;
  }
  /* The third state. A dash rather than a tick, because a column that is half
     selected must not claim to be selected — see `initMatrix`, which sets the
     property and `aria-checked="mixed"` together. */
  .av-check:indeterminate::before {
    clip-path: none;
    inset: calc(50% - 1px) 24%;
    border-radius: var(--av-radius-full);
  }
  /* Under a finger the box is the target: 18px is a comfortable mark beside a
     label and too small to aim at. Where the label wraps or points at the box
     the label is the target and this changes nothing that matters; where it
     does not — a select-all in a table header, a row tick, a filter list — the
     box is all there is. Raised through the component's own knob so the tick,
     the focus ring and the indeterminate bar all follow it. */
  @media (pointer: coarse) {
    .av-check {
      --av-check-size: var(--av-size-touch-min);
    }
  }
  .av-check:hover:not(:disabled) {
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--av-color-primary) 12%, transparent);
  }
  .av-check:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  /* Disabled is painted, never hidden: a fixed permission still has to be
     readable, and on the roles page the whole Owner column is this state. */
  .av-check:disabled {
    cursor: not-allowed;
    background: var(--av-surface-disabled);
    border-color: var(--av-border-subtle);
  }
  .av-check:checked:disabled,
  .av-check:indeterminate:disabled {
    background: var(--av-color-neutral-subtle);
    border-color: var(--av-border-default);
    color: var(--av-text-muted);
  }
  /* A checkbox with a label beside it. Lives here rather than in `_field.scss`
     for the same reason `.av-avatar` left the topbar partial: it is about the
     control, not about the form layout that first needed one. */
  .av-form-check {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    cursor: pointer;
  }
}
@layer components {
  /* Field ───────────────────────────────────────────────────────────── */
  .av-field {
    display: block;
  }
  /* For a quantity or a rate sitting beside a description: enough room for the
     value and its label, and no more. `flex-basis` rather than a width so it
     still collapses when the row wraps on a narrow screen. */
  .av-field--narrow {
    flex: 0 1 7.5rem;
  }
  /* The vertical rhythm of a form, and it has to name **both** block types.
     Written as `.av-field + .av-field` it spaced a stack of single fields and
     silently skipped every boundary involving a `.av-field-row`, because a row
     is not a field: `row → field`, `field → row` and `row → row` all measured a
     0px gap while the pair either side of them got 16.

     It shipped that way on the checkout's shipping address — first/last name,
     then Address flush against it, then City/Eircode flush against that — and
     nothing could see it. `lint:css` reads the SCSS and the SCSS is valid; the
     visual suite is documented as blind under roughly 34x34px and had recorded
     its baseline from the already-cramped markup, so it agreed with itself. It
     surfaced only when a new page put a field and a row in one stack and the
     gap was measured rather than looked at.

     `:is()` keeps this at 0-2-0, under the 0-3-0 ceiling and — importantly —
     under the 0-3-0 override below, which still wins and still zeroes the
     margin between two fields *inside* a row. */
  :is(.av-field, .av-field-row) + :is(.av-field, .av-field-row) {
    margin-block-start: var(--av-space-4);
  }
  .av-field__label {
    display: block;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
    margin-block-end: var(--av-space-1-5);
  }
  .av-field__required {
    color: var(--av-color-danger-text);
    margin-inline-start: 2px;
  }
  .av-field__hint {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block: var(--av-space-1-5) 0;
  }
  /* Present in the DOM before validation so `aria-describedby` can point at it
     from the start; empty until there is something to say. */
  .av-field__error {
    font-size: var(--av-font-size-xs);
    color: var(--av-color-danger-text);
    margin-block: var(--av-space-1-5) 0;
  }
  .av-field__error:empty {
    display: none;
  }
  /* Controls ────────────────────────────────────────────────────────── */
  .av-input,
  .av-select,
  .av-textarea {
    inline-size: 100%;
    min-block-size: var(--av-control-height, var(--av-control-md));
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-base);
    color: var(--av-text-primary);
    font: inherit;
    font-size: var(--av-font-size-sm);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-textarea {
    min-block-size: 88px;
    resize: vertical;
    line-height: var(--av-line-height-normal);
  }
  /* Figures line up on their decimal point when they are right-aligned and the
     digits are the same width — the difference between a column a reader can
     scan and one they have to read. */
  .av-input--num {
    text-align: end;
    font-variant-numeric: tabular-nums;
  }
  .av-input::placeholder,
  .av-textarea::placeholder {
    color: var(--av-text-muted);
  }
  .av-input::-ms-reveal,
  .av-input::-ms-clear {
    display: none;
  }
  .av-input:focus-visible,
  .av-select:focus-visible,
  .av-textarea:focus-visible {
    outline: none;
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 3px var(--av-color-primary-subtle);
  }
  .av-input:disabled,
  .av-select:disabled,
  .av-textarea:disabled {
    background: var(--av-surface-sunken);
    color: var(--av-text-disabled);
    cursor: not-allowed;
  }
  .av-input.is-invalid,
  .av-select.is-invalid,
  .av-textarea.is-invalid {
    border-color: var(--av-color-danger);
  }
  .av-input.is-invalid:focus-visible,
  .av-select.is-invalid:focus-visible,
  .av-textarea.is-invalid:focus-visible {
    box-shadow: 0 0 0 3px var(--av-color-danger-subtle);
  }
  /* The native arrow is drawn by the UA in its own colours, which do not follow
     a preset. Draw ours and reserve room for it. */
  .av-select {
    appearance: none;
    padding-inline-end: var(--av-space-8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--av-space-3) center;
    background-size: 16px;
  }
  [dir=rtl] .av-select {
    background-position: left var(--av-space-3) center;
  }
  /* Input group ─────────────────────────────────────────────────────────
     A prefix/suffix joined to the control. Radii are set with logical corner
     properties so the join stays on the correct side in RTL. */
  .av-input-group {
    display: flex;
    align-items: stretch;
    min-inline-size: 0;
  }
  .av-input-group > .av-input,
  .av-input-group > .av-select {
    flex: 1 1 auto;
    min-inline-size: 0;
  }
  .av-input-group__text {
    display: flex;
    align-items: center;
    padding-inline: var(--av-space-3);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-default);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-sm);
    white-space: nowrap;
  }
  .av-input-group > :first-child {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
  }
  .av-input-group > :last-child {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
  }
  .av-input-group > :not(:first-child) {
    margin-inline-start: -1px;
  }
  /* A focused control must paint its border over the neighbour it overlaps. */
  .av-input-group > :focus-within,
  .av-input-group > :focus-visible {
    position: relative;
    z-index: var(--av-z-raised);
  }
  /* Fieldsets ───────────────────────────────────────────────────────── */
  .av-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
  }
  .av-fieldset__legend {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    padding: 0;
    margin-block-end: var(--av-space-3);
  }
  /* Two columns at most, per the layout rules. */
  .av-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--av-space-4);
  }
  .av-field-row > * {
    min-inline-size: 0;
  }
  /* `.av-field + .av-field` spaces a *vertical* stack, and the two fields in a
     row are adjacent siblings too — so the second one was picking up a
     `margin-block-start` the first never had, and sat exactly one `--av-space-4`
     lower than its neighbour. The row already spaces itself with `gap`, so the
     margin was wrong twice: it misaligned the pair and double-spaced them.

     0-3-0 rather than the shorter `.av-field-row .av-field`, which is 0-2-0 and
     ties with the sibling rule — a tie is resolved by source order, and `@use`
     order is not something a fix should depend on. */
  .av-field-row > .av-field + .av-field {
    margin-block-start: 0;
  }
  @media (max-width: 767.98px) {
    .av-field-row {
      grid-template-columns: 1fr;
    }
  }
  /* Error summary ───────────────────────────────────────────────────────
     Focused after a failed submit: it is the first thing a screen-reader user
     lands on, and its links jump to the offending fields. */
  .av-form-errors {
    margin-block-end: var(--av-space-4);
    scroll-margin-block-start: var(--av-space-6);
  }
  .av-form-errors:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  .av-form-errors ul {
    margin: var(--av-space-2) 0 0;
    padding-inline-start: var(--av-space-5);
    font-size: var(--av-font-size-sm);
  }
  .av-form-errors li + li {
    margin-block-start: var(--av-space-1);
  }
  .av-form-errors a {
    color: inherit;
  }
  /* Form actions ────────────────────────────────────────────────────── */
  .av-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-5);
  }
  /* Sticky, because on a form this long the save button must not require
     scrolling. It sits inside .av-content, which is the scroll container. */
  .av-form-actions--sticky {
    position: sticky;
    inset-block-end: 0;
    z-index: var(--av-z-sticky);
    margin-block-start: var(--av-space-6);
    padding: var(--av-space-3) var(--av-space-4);
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-lg);
  }
  /* Character counter ───────────────────────────────────────────────── */
  .av-counter {
    font-variant-numeric: tabular-nums;
  }
  .av-counter.is-over {
    color: var(--av-color-danger-text);
    font-weight: var(--av-font-weight-semibold);
  }
  /* Search-engine preview ───────────────────────────────────────────── */
  .av-seo-preview {
    padding: var(--av-space-3) var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-base);
  }
  .av-seo-preview__url {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-seo-preview__title {
    font-size: var(--av-font-size-lg);
    color: var(--av-text-link);
    margin-block: var(--av-space-1) 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-seo-preview__desc {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Floating label ──────────────────────────────────────────────────── */
  /* Named `.av-float-label`, not Bootstrap's `.form-floating`.

     The label floats on `:focus` or when the field has content, and
     `:not(:placeholder-shown)` is how the second half is detected — which is
     why the control needs a `placeholder` attribute even though it is never
     seen. A single space is enough. Without it the selector never matches and
     a filled field keeps its label sitting across the value.

     The label comes *after* the control in the DOM, because CSS can only look
     forwards from the control to a sibling. Reading order is unaffected: the
     label is still associated by `for`/`id`, and a screen reader announces the
     accessible name before the value regardless of source order. */
  .av-float-label {
    position: relative;
    display: block;
  }
  .av-float-label > :is(.av-input, .av-select, .av-textarea) {
    /* Room for the floated label to sit inside the control rather than above
       it — that inset is the whole point of the pattern. */
    padding-block: var(--av-space-5) var(--av-space-1-5);
  }
  .av-float-label > label {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: var(--av-space-3);
    /* The label must not swallow clicks meant for the field underneath it. */
    pointer-events: none;
    padding-block: var(--av-space-3);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-sm);
    transform-origin: var(--av-float-origin, 0) 0;
    transition: transform var(--av-duration-fast) var(--av-ease-standard);
  }
  [dir=rtl] .av-float-label > label {
    --av-float-origin: 100%;
  }
  /* `transform-origin` has no logical form. The float itself is vertical, so
     `translateY` needs no mirroring — but the label also *shrinks*, and it has
     to shrink towards the field's leading edge. An origin of `0 0` is
     physically top-left, so under RTL the label would contract away from the
     edge it is aligned to and drift into the middle of the control. The origin
     travels as a custom property that the `[dir="rtl"]` rule flips, the same
     tactic the sidebar sweep and the auth panel already use. */
  .av-float-label > :is(.av-input, .av-select, .av-textarea):focus + label,
  .av-float-label > :is(.av-input, .av-textarea):not(:placeholder-shown) + label,
  .av-float-label > .av-select:valid + label {
    transform: translateY(calc(var(--av-space-2) * -1)) scale(0.78);
  }
  /* File input ──────────────────────────────────────────────────────── */
  /* The file button lives in the control's shadow tree, so it cannot be
     restyled with a class — `::file-selector-button` is the only handle there
     is. It also does not inherit `font` from the input the way an ordinary
     child would, so that has to be restated rather than assumed. */
  .av-input[type=file] {
    padding: 0;
    /* The control's own height comes from the button inside it; a min-height
       on the wrapper leaves the button floating in a taller box. */
    min-block-size: 0;
    font-size: var(--av-font-size-sm);
  }
  .av-input[type=file]::file-selector-button {
    margin-inline-end: var(--av-space-3);
    padding: var(--av-space-2) var(--av-space-3);
    border: 0;
    border-inline-end: 1px solid var(--av-border-default);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
    font: inherit;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-input[type=file]::file-selector-button:hover {
    background: var(--av-surface-base);
  }
  /* See `.av-field-line__hint--center`: the same role for the other field
     system, and separate because the two hints are separate components. */
  .av-field__hint--center {
    text-align: center;
  }
  /* A select sized by its longest option rather than by its column — a sort
     control in a results bar, where a full-width control would read as a field
     somebody has to fill in. It must come after `.av-select`'s own
     `inline-size`, which is the same specificity: a modifier written above the
     rule it modifies is a modifier that does nothing. */
  .av-select--auto {
    inline-size: auto;
  }
}
@layer components {
  /* Date and time ───────────────────────────────────────────────────── */
  /* The controls inherit `.av-input`; only the browser-supplied internals need
     attention. The indicator is a shadow-tree pseudo-element, so it cannot be
     given a class — and it is not inheriting `color`, which is why a dark
     theme otherwise shows a black icon on a near-black field. */
  .av-input[type=date],
  .av-input[type=time],
  .av-input[type=datetime-local],
  .av-input[type=month],
  .av-input[type=week] {
    /* Chromium sizes these to their content and ignores `inline-size: 100%`
       from the shared rule unless the intrinsic sizing is reset. */
    min-inline-size: 0;
  }
  .av-input::-webkit-calendar-picker-indicator {
    padding: var(--av-space-1);
    border-radius: var(--av-radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
  }
  /* In dark mode the indicator is a black glyph drawn by the UA. `filter` is
     the only handle on it, and inverting is the one operation that works
     across all of them. Scoped to the mode attribute rather than a media
     query, so it follows the theme engine rather than the OS. */
  [data-bs-theme=dark] .av-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
  }
  /* A date range is two native inputs whose bounds are wired together, so
     neither can be set past the other. The pairing is the component. */
  .av-daterange {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
  }
  .av-daterange > .av-input {
    flex: 1;
    min-inline-size: 0;
  }
  .av-daterange__sep {
    flex: none;
    color: var(--av-text-muted);
  }
  /* Colour ──────────────────────────────────────────────────────────── */
  /* `<input type="color">` renders as a filled box. The UA gives it a border
     and padding that no theme wants, so both are removed and the swatch is
     allowed to fill the control. */
  .av-color {
    inline-size: var(--av-space-10);
    block-size: var(--av-control-height, var(--av-control-md));
    padding: var(--av-space-0-5);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-base);
    cursor: pointer;
  }
  .av-color::-webkit-color-swatch-wrapper {
    padding: 0;
  }
  .av-color::-webkit-color-swatch {
    border: 0;
    border-radius: var(--av-radius-sm);
  }
  .av-color::-moz-color-swatch {
    border: 0;
    border-radius: var(--av-radius-sm);
  }
  /* The paired text field shows the hex value, because a swatch alone cannot
     be read out, copied, or typed into — and a colour is something people
     paste far more often than they pick. */
  .av-color-field {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
  }
  .av-color-field__value {
    inline-size: 7rem;
    font-family: var(--av-font-mono);
    text-transform: uppercase;
  }
  /* Range ───────────────────────────────────────────────────────────── */
  /* The track and thumb are shadow-tree pseudo-elements, and the vendor
     prefixes cannot be grouped: an unrecognised selector invalidates the whole
     rule, so `::-webkit-slider-thumb, ::-moz-range-thumb` styles neither. Each
     one gets its own block. */
  .av-range {
    inline-size: 100%;
    block-size: var(--av-space-5);
    padding: 0;
    background: none;
    appearance: none;
    cursor: pointer;
  }
  .av-range:focus-visible {
    outline: 2px solid var(--av-focus-ring);
    outline-offset: 4px;
  }
  /* The filled portion is a gradient stop driven by one custom property that
     `initSlider` writes. Firefox has `::-moz-range-progress` and Chromium has
     nothing, so doing it on the track works in both. */
  .av-range::-webkit-slider-runnable-track {
    block-size: var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: linear-gradient(var(--av-color-primary), var(--av-color-primary)) 0/var(--av-range-fill, 0%) 100% no-repeat, var(--av-surface-sunken);
  }
  .av-range::-moz-range-track {
    block-size: var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
  }
  .av-range::-moz-range-progress {
    block-size: var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
  }
  .av-range::-webkit-slider-thumb {
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
    /* Chromium positions the thumb from the top of the track, not centred on
       it, so it has to be pulled back by half the difference. Firefox centres
       it and needs no equivalent. */
    margin-block-start: calc((var(--av-space-1-5) - var(--av-space-4)) / 2);
    border: 2px solid var(--av-surface-raised);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    box-shadow: var(--av-shadow-sm);
    appearance: none;
  }
  /* Both thumbs, both engines. The track can stay thin — it is a line, not a
     target — but the thumb is the whole control under a finger, and 16px is
     smaller than the fingertip that has to land on it and then keep dragging. */
  @media (pointer: coarse) {
    /* The element's own box is what a finger lands on — a 24px thumb drawn
       inside a 20px input is a bigger picture of the same small target. The
       track is painted by its own pseudo-element at its own height and stays
       a thin line; this only pads the box around it. */
    .av-range {
      min-block-size: var(--av-size-touch-min);
    }
    .av-range::-webkit-slider-thumb {
      inline-size: var(--av-size-touch-min);
      block-size: var(--av-size-touch-min);
      margin-block-start: calc((var(--av-space-1-5) - var(--av-size-touch-min)) / 2);
    }
    .av-range::-moz-range-thumb {
      inline-size: var(--av-size-touch-min);
      block-size: var(--av-size-touch-min);
    }
  }
  .av-range::-moz-range-thumb {
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
    border: 2px solid var(--av-surface-raised);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    box-shadow: var(--av-shadow-sm);
  }
  .av-range-field {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
  }
  .av-range-field__value {
    flex: none;
    min-inline-size: 3rem;
    font-size: var(--av-font-size-sm);
    /* Tabular figures, or the row twitches sideways as the number changes
       width while dragging. */
    font-variant-numeric: tabular-nums lining-nums;
    text-align: end;
    color: var(--av-text-secondary);
  }
}
@layer components {
  /* Segmented control ───────────────────────────────────────────────── */
  .av-segmented {
    display: flex;
    padding: 3px;
    gap: 2px;
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
  }
  .av-segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .av-segmented label {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--av-space-1-5);
    padding: var(--av-space-1-5) var(--av-space-2);
    border-radius: calc(var(--av-radius-md) - 2px);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
    /* A segment is one short choice. Allowed to wrap, a label with a count
       ("Published (1)") broke onto two lines in a narrow header row and its
       text ran into the next segment's background. */
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  /* The label is the whole control here — the radio inside it is positioned
     out of sight — and at xs type with 6px of padding the segment came to 20px
     tall. It is a switcher people tap repeatedly, so the miss is felt more than
     once. */
  @media (pointer: coarse) {
    .av-segmented label {
      min-block-size: var(--av-size-touch-min);
    }
  }
  .av-segmented label:hover {
    color: var(--av-text-secondary);
  }
  .av-segmented label:has(input:checked),
  .av-segmented input:checked + label {
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-sm);
  }
  .av-segmented label:has(input:focus-visible),
  .av-segmented input:focus-visible + label {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: 1px;
  }
}
@layer components {
  /* Cards ───────────────────────────────────────────────────────────── */
  .av-card {
    --av-card-padding: var(--av-space-5);
    position: relative;
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm);
    /* No `contain` here, and that is the fix rather than an omission.
       `contain: layout` was set for the reflow win, with `paint` deliberately
       left out so the hover shadow and the stat card's accent bar could still
       draw outside the padding box. But layout containment *also* makes the
       element a stacking context and an absolute containing block — so every
       dropdown, tooltip and popover opened inside a card had its
       `z-index: var(--av-z-popover)` scoped to that card, and the next card in
       source order simply painted over the open menu.

       Nothing was clipped, which is what made it read as an overflow bug and
       sent the first look at `overflow` and `z-index`, where there was nothing
       wrong. Containment is a performance hint; a menu you cannot read is a
       broken control, and the trade is not close. */
    transition: box-shadow var(--av-duration-normal) var(--av-ease-standard), border-color var(--av-duration-normal) var(--av-ease-standard), translate var(--av-duration-normal) var(--av-ease-standard);
  }
  [data-bs-theme=dark] .av-card {
    box-shadow: 0 1px 3px 0 oklch(var(--av-shadow-color)/0.4), inset 0 1px 0 0 oklch(var(--av-highlight-color)/0.04);
  }
  /* Hover depth is opt-in via --interactive. A static reporting card that rises
     under the pointer implies it can be clicked, and most cards cannot. */
  .av-card--interactive:hover {
    translate: 0 var(--av-lift);
    border-color: color-mix(in oklab, var(--av-color-primary) 24%, var(--av-border-subtle));
    box-shadow: var(--av-shadow-lg);
  }
  [data-bs-theme=dark] .av-card--interactive:hover {
    box-shadow: var(--av-shadow-lg), 0 0 24px color-mix(in oklab, var(--av-color-primary) 12%, transparent);
  }
  .av-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--av-space-3);
    padding: var(--av-card-padding) var(--av-card-padding) 0;
  }
  .av-card__title {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  /* A card whose heading is the link to the thing it describes. Blue and
     underlined reads as a control inside a block that is already one, so the
     colour lands on hover instead, where it says the same thing without
     shouting it on arrival.

     Deliberately *not* the stretched `::after` overlay `.av-product-card`
     uses. A feed card carries a category and an author that are links in their
     own right, and a full-card overlay would sit on top of both. */
  .av-card__title a {
    color: inherit;
    text-decoration: none;
  }
  .av-card__title a:hover {
    color: var(--av-color-primary-text);
  }
  .av-card__subtitle {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    margin: var(--av-space-1) 0 0;
  }
  .av-card__body {
    padding: var(--av-card-padding);
  }
  /* A body whose content is a list of rows that already supply their own
     vertical rhythm — `.av-activity`, and anything else whose items pad
     themselves. Without it the first row pays the card's block padding *and*
     its own, which reads as a gap the designer did not put there.

     The two steps are asymmetric because that is what shipped, and this
     modifier preserves it rather than tidying it: the value was arrived at by
     eye on one card, and squaring it is a rhythm decision for the pass that
     reviews card spacing, not for the pass that moves a declaration out of
     markup. */
  .av-card__body--rows {
    padding-block: var(--av-space-2) var(--av-space-3);
  }
  /* The one control in a header row that is not the title — "View all", a
     filter, a link onward. It steps down from the title rather than matching
     it, so the heading stays the thing the eye lands on. It is a size only:
     what the control *is* stays with its own class, which is why the
     analytics card wears `.av-link` alongside it. */
  .av-card__action {
    font-size: var(--av-font-size-sm);
  }
  /* An opening paragraph inside a body — a bio, a summary, the sentence that
     introduces the list beneath it. `__subtitle` is the line under a title in
     the *header*; this is the first thing in the body, and it does not carry
     the header's top margin. */
  .av-card__lead {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  /* Who wrote it and when, at the foot of a feed card. `__footer` is the
     bordered tray a card's *actions* sit in; a byline is a line of metadata
     with no rule above it, so it is its own element rather than a modifier
     that has to unset a border it never wanted.

     The last child is pushed to the far edge rather than the row being
     `space-between`, so a byline of three parts keeps the first two together
     and only the date travels — and it travels the logical way, so RTL needs
     no rule of its own. */
  .av-card__byline {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-4);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  .av-card__byline > :last-child {
    margin-inline-start: auto;
  }
  /* A byline is a foot on a feed card and a head on a comment — the same row
     of who-and-when, read before the text as often as after it. */
  .av-card__byline:first-child {
    margin-block-start: 0;
  }
  .av-card__footer {
    padding: var(--av-space-3) var(--av-card-padding);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  /* A card whose content is not wrapped in `.av-card__body` — prose, a short
     list, a definition block. All five public pages were written against this
     class and none of it existed, so every one rendered as text jammed against
     its own border. `__body` stays correct for anything with a header or a
     footer; this is the single-block case. */
  .av-card--pad {
    padding: var(--av-space-5);
  }
  .av-card--pad > :first-child {
    margin-block-start: 0;
  }
  .av-card--pad > :last-child {
    margin-block-end: 0;
  }
  .av-card--flush-body .av-card__body {
    padding: 0;
  }
  .av-card--flush-body .av-card__header {
    padding-block-end: var(--av-space-4);
  }
  /* The card that holds an irreversible action. Border only: a danger *ground*
     turns the whole panel into an alert, and the panel is where a person also
     reads what they are about to lose. Two pages had been writing this colour
     inline, which is the same modifier with no name and no place to change it. */
  .av-card--danger {
    border-color: var(--av-color-danger-border);
  }
  /* Media card ──────────────────────────────────────────────────────── */
  /* A card led by an image. The media element bleeds to the card's edge, which
     needs `overflow: hidden` on the card — and that is the one place this
     build accepts clipping on a card, because the image is the only child that
     would ever escape and a dropdown inside a media card's body still opens
     into the top layer via the popover promotion in initDropdowns. */
  .av-card--media {
    overflow: hidden;
  }
  .av-card__media {
    display: block;
    inline-size: 100%;
    /* A fixed ratio rather than a fixed height: a row of media cards with
       different image proportions otherwise has its titles on different lines,
       and `object-fit` without a ratio does nothing at all. */
    aspect-ratio: var(--av-card-media-ratio, 16/9);
    /* And the ratio has to be able to win. An <img> carrying width and height
       attributes — which every performance guide correctly tells authors to
       write, because they are what stops the page reflowing as images arrive —
       gets a presentational `height` from the UA stylesheet, and an explicit
       height beats an aspect ratio outright. The first six of these shipped at
       360x400 inside a rule that says 16:9, and nothing failed: the well was
       simply the wrong shape. */
    block-size: auto;
    object-fit: cover;
    /* The image sits on the sunken surface while it loads, so a slow or broken
       image leaves a considered gap rather than a white hole in a dark card. */
    background: var(--av-surface-sunken);
  }
  /* A media card whose image comes *after* the body — the modifier is on the
     card rather than the image so the order is declared once, and the DOM order
     stays reading order. */
  .av-card--media-end {
    display: flex;
    flex-direction: column;
  }
  .av-card--media-end .av-card__media {
    order: 1;
  }
  /* Hero band ────────────────────────────────────────────────────────────
     A search field centred in a plain white panel reads as an unfinished
     section rather than a deliberate one, and no amount of spacing fixes
     that — the band needs a ground.

     Both layers are the ones the profile cover already proved, and the order
     matters for the same reason it did there: background layers paint first
     listed on top, so there is no positioned pseudo-element to stack wrongly
     against the content. The wash is `--av-gradient-brand-soft`, which is two
     10% mixes over transparent rather than a fill — so it tints whatever
     surface it lands on, follows every preset, and moves the text contrast
     underneath it by almost nothing. The dots are mixed from
     `--av-text-primary` for the same reason the cover mixes its own from
     `--av-text-on-primary`: the token that is already legible against this
     ground in both modes. */
  .av-card--hero {
    border-color: transparent;
    background-image: radial-gradient(circle at 1px 1px, color-mix(in oklch, var(--av-text-primary) 7%, transparent) 1px, transparent 0), var(--av-gradient-brand-soft);
    background-size: 22px 22px, auto;
  }
}
@layer components {
  /* Carousel ────────────────────────────────────────────────────────── */
  /* CSS scroll-snap, not a transform track — which is what a carousel library
     is mostly for, and what makes it 40 KB.
     Snap gives native momentum, native touch, native keyboard scrolling and a
     real scrollbar for anyone who wants one, all with no script running during
     the gesture. `initCarousel` only adds the previous/next buttons and the
     dots, and both of those are `scrollTo` calls.
     The consequence worth knowing: because it is a real scroll container, the
     slides are always in the DOM and always findable by browser find-in-page,
     which a transform track with `overflow: hidden` breaks. */
  .av-carousel {
    position: relative;
  }
  .av-carousel__track {
    display: flex;
    gap: var(--av-space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* Momentum scrolling on iOS, and no visible bar on a trackpad — the dots
       and buttons are the affordance. */
    scrollbar-width: none;
    scroll-behavior: smooth;
  }
  .av-carousel__track::-webkit-scrollbar {
    display: none;
  }
  /* Reduced motion has to turn off the *scroll* animation too, not just the
     CSS transitions — `scroll-behavior: smooth` is animation with no duration
     to zero, so nothing the token layer does can reach it, and `scrollTo` from
     the buttons inherits it. The global reset in `utilities/_motion.scss` now
     covers it as well; this stays because it is the rule that says why, and
     because it survives that reset being narrowed. */
  @media (prefers-reduced-motion: reduce) {
    .av-carousel__track {
      scroll-behavior: auto;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-carousel__track {
    scroll-behavior: auto;
  }
  .av-carousel__slide {
    flex: 0 0 var(--av-carousel-slide, 100%);
    min-inline-size: 0;
    scroll-snap-align: start;
  }
  .av-carousel__nav {
    position: absolute;
    inset-block-start: 50%;
    translate: 0 -50%;
    display: grid;
    place-items: center;
    inline-size: var(--av-space-8);
    block-size: var(--av-space-8);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-float);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-md);
    cursor: pointer;
  }
  /* Logical insets, so previous sits on the leading edge in both directions.
     The *icons* still have to be flipped by the markup — a chevron is a
     direction, and there is no logical form for a glyph. */
  .av-carousel__nav--prev {
    inset-inline-start: calc(var(--av-space-4) * -1);
  }
  .av-carousel__nav--next {
    inset-inline-end: calc(var(--av-space-4) * -1);
  }
  /* At the ends the button is disabled rather than hidden: a control that
     disappears moves everything beside it, and the reappearing button lands
     under a pointer that was aiming at something else. */
  .av-carousel__nav[disabled] {
    opacity: 0.4;
    cursor: default;
  }
  .av-carousel__dots {
    display: flex;
    justify-content: center;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-3);
  }
  .av-carousel__dot {
    inline-size: var(--av-space-2);
    block-size: var(--av-space-2);
    padding: 0;
    border: 0;
    border-radius: var(--av-radius-full);
    background: var(--av-border-default);
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), inline-size var(--av-duration-fast) var(--av-ease-standard);
  }
  /* The smallest control in the product: an 8px pill in a row of 8px pills.
     The dot stays 8px — it is a position indicator and a 24px disc would read
     as a button — and the *target* grows around it instead, through padding
     and a background clipped to the dot's own box. The gap between dots is
     already `--av-space-2`, so the enlarged targets sit edge to edge rather
     than overlapping. */
  @media (pointer: coarse) {
    .av-carousel__dot {
      padding: var(--av-space-2);
      background-clip: content-box;
      box-sizing: content-box;
    }
  }
  .av-carousel__dot[aria-current=true] {
    inline-size: var(--av-space-5);
    background: var(--av-color-primary);
  }
}
@layer components {
  /* Context menu ────────────────────────────────────────────────────── */
  /* This one *is* `role="menu"`, where the notification panel deliberately is
     not: every row here is a command, which is exactly what the role promises.
     The notification rows are links carrying a timestamp, and calling those a
     menu tells a reader to expect actions that are not there.

     It reuses `.av-dropdown__menu`'s chrome and the top-layer promotion, so
     open, close, outside-click and arrow-key roving all come from
     `initDropdowns` rather than a second implementation. Only the placement
     differs — a dropdown anchors to a trigger, a context menu to a point. */
  /* The markup carries `.av-dropdown__menu` too, so the panel chrome and every
     row style come from one place rather than a second copy. But that class
     also carries a *closed* state — `opacity: 0; visibility: hidden` — which is
     only ever undone by `.av-dropdown.is-open .av-dropdown__menu`, and a
     context menu has no `.av-dropdown` ancestor to supply it. Left alone, the
     menu opens into the top layer, measures correctly, and is invisible.

     Both selectors below are written as `.av-context-menu.av-dropdown__menu`
     (0-2-0) rather than `.av-context-menu` (0-1-0). At equal specificity the
     cascade falls back to source order, and `@use` order is not something a
     rule should depend on — this codebase has been bitten by that twice
     already. */
  .av-context-menu.av-dropdown__menu {
    /* Fixed, and positioned by JS in viewport coordinates: a context menu
       anchors to a point, not to a trigger. No numeric z-index — it is
       promoted to the top layer, above every stacking context and outside
       every scroll container. */
    position: fixed;
    inset: auto;
    min-inline-size: 12rem;
    translate: none;
    scale: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--av-duration-fastest) var(--av-ease-standard), visibility 0s linear var(--av-duration-fastest);
  }
  .av-context-menu.av-dropdown__menu:popover-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
  /* A target that has been right-clicked keeps a visible marker while its menu
     is open — otherwise, with the pointer moved away to the menu, nothing on
     the page says which row the commands will act on. */
  .av-context-target.is-context-open {
    background-image: var(--av-gradient-brand-soft);
    outline: 1px solid var(--av-color-primary-border);
    outline-offset: -1px;
  }
}
@layer components {
  /* Drawer / offcanvas ──────────────────────────────────────────────── */
  /* A native <dialog> opened with showModal(), like `.av-dialog` — which buys
     the focus trap, Escape, page inerting and focus restore rather than
     reimplementing four things that are easy to get subtly wrong.

     What differs from a modal is only where it sits and how it arrives: a
     drawer is pinned to one edge, full height, and slides in from that edge.
     That is a positioning change, not a new component, which is why this
     borrows the dialog's backdrop and closing mechanics wholesale. */
  .av-drawer {
    position: fixed;
    inset-block: 0;
    /* Logical, so "end" is the right edge in English and the left in Arabic
       with no mirrored rule and no second modifier. */
    inset-inline-end: 0;
    inset-inline-start: auto;
    /* Width travels as a variable so a drawer that carries a two-column
       interior can widen without restating the viewport clamp — and so the
       clamp stays in one place, which is the half that matters at 320px. */
    --av-drawer-size: 26rem;
    inline-size: min(var(--av-drawer-size), 100vw - var(--av-space-8));
    max-block-size: none;
    block-size: 100dvh;
    /* The reset's `* { margin: 0 }` already killed the UA centring; stating it
       here keeps the drawer pinned if that reset ever changes. */
    margin: 0;
    padding: 0;
    border: 0;
    border-inline-start: 1px solid var(--av-border-subtle);
    border-radius: 0;
    background: var(--av-surface-overlay);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-2xl);
  }
  /* Wide is for a drawer with an interior of its own — the messages panel puts
     a conversation rail beside a thread, and at 26rem the thread that is left
     is narrower than the bubbles it has to hold. */
  .av-drawer--wide {
    --av-drawer-size: 30rem;
  }
  .av-drawer--start {
    inset-inline-start: 0;
    inset-inline-end: auto;
    border-inline-start: 0;
    border-inline-end: 1px solid var(--av-border-subtle);
  }
  .av-drawer::backdrop {
    background: var(--av-overlay);
    backdrop-filter: blur(2px);
  }
  /* `translate` carries the slide, and it has no logical form — so the
     direction travels as a custom property the `--start` modifier and the RTL
     rule both flip. The same tactic the sidebar sweep and the auth panel use. */
  .av-drawer[open] {
    animation: av-drawer-in var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-drawer[open]::backdrop {
    animation: av-fade-in var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-drawer.is-closing {
    animation: av-drawer-out var(--av-duration-fast) var(--av-ease-accelerate) forwards;
  }
  .av-drawer {
    --av-drawer-from: 100%;
  }
  .av-drawer--start {
    --av-drawer-from: -100%;
  }
  [dir=rtl] .av-drawer {
    --av-drawer-from: -100%;
  }
  [dir=rtl] .av-drawer--start {
    --av-drawer-from: 100%;
  }
  @keyframes av-drawer-in {
    from {
      translate: var(--av-drawer-from) 0;
    }
  }
  @keyframes av-drawer-out {
    to {
      translate: var(--av-drawer-from) 0;
    }
  }
  /* Bottom sheet ────────────────────────────────────────────────────── */
  /* The same dialog, anchored to the block end instead of an inline edge. It
     is a separate component rather than a drawer modifier because the axis
     changes everything below it: the size is capped by viewport height rather
     than width, it rounds only its leading corners, and it carries a grab
     handle that a side drawer has no use for. */
  .av-sheet {
    position: fixed;
    inset-block-end: 0;
    inset-block-start: auto;
    inset-inline: 0;
    inline-size: 100%;
    /* The UA stylesheet gives every <dialog> a `max-width` that subtracts its
       default padding and border — around 38px in Chromium. A sheet is
       supposed to meet both edges of the viewport, and without this it sits
       symmetrically inset by that amount, which reads as a slightly-too-narrow
       panel rather than a bug. `inline-size: 100%` alone does not fix it: a
       max wins over a used size. */
    max-inline-size: 100%;
    /* dvh, not vh: on mobile Safari the URL bar changes the viewport, and a
       sheet sized in vh is cut off by exactly that difference. */
    max-block-size: 85dvh;
    margin: 0;
    padding: 0;
    border: 0;
    border-start-start-radius: var(--av-radius-xl);
    border-start-end-radius: var(--av-radius-xl);
    background: var(--av-surface-overlay);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-2xl);
  }
  .av-sheet::backdrop {
    background: var(--av-overlay);
    backdrop-filter: blur(2px);
  }
  .av-sheet[open] {
    animation: av-sheet-in var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-sheet[open]::backdrop {
    animation: av-fade-in var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-sheet.is-closing {
    animation: av-sheet-out var(--av-duration-fast) var(--av-ease-accelerate) forwards;
  }
  @keyframes av-sheet-in {
    from {
      translate: 0 100%;
    }
  }
  @keyframes av-sheet-out {
    to {
      translate: 0 100%;
    }
  }
  /* The handle is decoration — it is `aria-hidden` in the markup, and the
     sheet is dismissed by Escape, the backdrop or an explicit close button.
     A drag affordance that is the *only* way out is unusable by keyboard. */
  .av-sheet__handle {
    inline-size: var(--av-space-10);
    block-size: var(--av-space-1);
    margin: var(--av-space-3) auto;
    border-radius: var(--av-radius-full);
    background: var(--av-border-default);
  }
  /* Shared body chrome for both, so a drawer and a sheet cannot drift apart. */
  .av-drawer__inner,
  .av-sheet__inner {
    display: flex;
    flex-direction: column;
    block-size: 100%;
    max-block-size: inherit;
  }
  .av-drawer__header,
  .av-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
    padding: var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-drawer__title,
  .av-sheet__title {
    margin: 0;
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-drawer__body,
  .av-sheet__body {
    flex: 1;
    min-block-size: 0;
    padding: var(--av-space-4);
    overflow-y: auto;
  }
  .av-drawer__footer,
  .av-sheet__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--av-space-2);
    padding: var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
  }
}
@layer components {
  /* Rating ──────────────────────────────────────────────────────────── */
  /* Interactive ratings are a radio group, not a row of buttons. A radio group
     gives arrow-key selection, a single tab stop, and "3 of 5 stars" announced
     as one control — all from the platform. Buttons would need every one of
     those reimplemented, and the reimplementation is what usually ships broken.
     `initRating` only handles the hover preview, which has no native
     equivalent. */
  .av-rating {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-0-5);
    border: 0;
    padding: 0;
    margin: 0;
  }
  /* The input is hidden from sight but not from the accessibility tree or the
     keyboard — `display: none` or `visibility: hidden` would take it out of the
     tab order and the group would stop working entirely. */
  .av-rating input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
  }
  /* `.av-rating__star` is the read-only star, and it shares every rule with the
     interactive label so a review list and the editor beside it cannot drift
     apart — which was the reason the static variant was built out of labels in
     the first place. The cost of that shortcut is below. */
  .av-rating label,
  .av-rating__star {
    display: grid;
    place-items: center;
    padding: var(--av-space-0-5);
    color: var(--av-border-default);
    transition: color var(--av-duration-fastest) var(--av-ease-standard);
  }
  .av-rating label {
    cursor: pointer;
  }
  .av-rating svg {
    inline-size: var(--av-space-5);
    block-size: var(--av-space-5);
    fill: currentColor;
  }
  /* Lit stars are marked by the module rather than selected with a sibling
     combinator. `~` only looks *forward*, so a CSS-only version has to reverse
     the DOM order and then fight it back with `flex-direction: row-reverse` —
     which puts the keyboard's left/right arrows in the opposite order to the
     stars on screen. A class costs one line of JS and keeps the axis honest. */
  .av-rating label.is-on,
  .av-rating__star.is-on {
    color: var(--av-color-warning);
  }
  /* The focus ring belongs on the label, because the input it belongs to is the
     one-pixel box above. Without this the group is operable by keyboard with no
     visible indication of where you are. */
  .av-rating input:focus-visible + label {
    outline: 2px solid var(--av-focus-ring);
    outline-offset: 2px;
    border-radius: var(--av-radius-xs);
  }
  /* Read-only display. The comment here used to say "no inputs, no pointer",
     and the markup underneath it was five real radio buttons in a fieldset with
     one `checked` — a live radio group announcing itself as a group, reachable
     by Tab, changed by the arrow keys, and repainted by `initRating`'s hover
     preview, so pointing at an average score visibly moved it and clicking set
     it. `cursor: default` was the entire enforcement of "read-only".

     A control that cannot be operated must not be built out of controls. The
     static variant is a `<div role="img">` with an `aria-label` carrying the
     score in words and five inert `<span>`s, so there is nothing to focus,
     nothing to change, and one accessible name that states the value rather
     than five options implying it can be chosen. The module needs no guard: it
     already returns early when a group holds no radio inputs. */
  .av-rating--static {
    pointer-events: none;
  }
  .av-rating--sm svg {
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
  }
  .av-rating--lg svg {
    inline-size: var(--av-space-7);
    block-size: var(--av-space-7);
  }
}
@layer components {
  /* Banner ──────────────────────────────────────────────────────────── */
  /* An alert speaks about the thing next to it; a banner speaks about the whole
     application — a trial ending, a scheduled outage, a region degraded. That
     is why it spans the shell rather than sitting in a card, and why dismissal
     is remembered: a page-level notice that returns on every navigation is the
     fastest way to teach someone to stop reading banners.
     `.av-alert` deliberately has no dismissal memory, because an inline alert
     is about state the page can re-derive. */
  .av-banner {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
  }
  .av-banner__icon {
    flex: none;
    inline-size: var(--av-space-5);
    block-size: var(--av-space-5);
    color: var(--av-banner-accent, var(--av-color-primary));
  }
  .av-banner__body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-banner__title {
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-banner__actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--av-space-2);
  }
  /* Role modifiers tint the accent and the ground from the same pair, so the
     icon and the wash can never disagree about severity. */
  .av-banner--info {
    --av-banner-accent: var(--av-color-info);
    background: var(--av-color-info-subtle);
  }
  .av-banner--success {
    --av-banner-accent: var(--av-color-success);
    background: var(--av-color-success-subtle);
  }
  .av-banner--warning {
    --av-banner-accent: var(--av-color-warning);
    background: var(--av-color-warning-subtle);
  }
  .av-banner--danger {
    --av-banner-accent: var(--av-color-danger);
    background: var(--av-color-danger-subtle);
  }
  /* Sticky is opt-in. A banner pinned above a long form eats vertical space on
     a laptop for the whole session, which is a worse trade than scrolling past
     it once. */
  .av-banner--sticky {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-sticky);
  }
}
@layer components {
  /* KPI card ────────────────────────────────────────────────────────── */
  /* Distinct from `.av-stat-card`, which reports one number with a trend. A KPI
     reports a number *against a target* — so it carries a bar, a target label,
     and a state that says whether the target is being met. Folding the two
     together would put a progress bar on every stat card in the product. */
  /* `--av-space-5`, not `var(--av-card-padding)`. That token is declared inside
     the `.av-card` rule, so it exists only for cards and their descendants — a
     KPI is neither, the reference resolved to nothing, and the whole `padding`
     declaration became invalid at computed-value time and fell back to `0`.
     The content sat flush against all four edges.

     `check:tokens` does not catch this: the property *is* defined, just not in
     a scope this element inherits from. Borrowing another component's private
     variable is the mistake — a KPI reads the spacing scale directly. */
  .av-kpi {
    display: flex;
    flex-direction: column;
    /* The rhythm is deliberate rather than one flat gap: the label belongs to
       the value it introduces, and the target line belongs to the bar it
       explains. Two tight pairs with air between them reads as two facts, not
       four stacked lines. */
    gap: var(--av-space-1);
    padding: var(--av-space-5);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
  }
  .av-kpi__label {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
    /* The label is a caption for the number: no descender clash, and it must
       not drift away from the value when the card stretches in a grid row. */
    line-height: var(--av-line-height-snug);
  }
  /* Pinned to the bottom, which is what keeps a row of KPI cards readable: a
     label that wraps to two lines would otherwise push its own bar down and
     the bars across the row would step like a staircase. `auto` here aligns
     every bar to the same line regardless of what is above it, and the value's
     own bottom margin guarantees the minimum air when nothing wraps. */
  .av-kpi__bar {
    margin-block-start: auto;
  }
  .av-kpi__value {
    margin: 0 0 var(--av-space-4);
    font-size: var(--av-font-size-3xl);
    font-weight: var(--av-font-weight-bold);
    /* Tabular figures so a column of KPIs does not jitter as values update —
     the count-up module animates these, and proportional digits make the
     number visibly change width on every frame. */
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--av-text-primary);
    line-height: var(--av-line-height-tight);
  }
  .av-kpi__target {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* The track is the element and the fill is the pseudo-element, so the
     progress value can live in one custom property and needs no inner div. */
  .av-kpi__bar {
    position: relative;
    block-size: var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    overflow: hidden;
  }
  .av-kpi__bar::before {
    content: "";
    position: absolute;
    inset-block: 0;
    /* Logical, so the bar fills from the leading edge under RTL rather than
       growing out of the wrong end. */
    inset-inline-start: 0;
    inline-size: clamp(0%, var(--av-kpi-progress, 0%), 100%);
    border-radius: inherit;
    background: var(--av-kpi-fill, var(--av-color-primary));
    transition: inline-size var(--av-duration-slow) var(--av-ease-decelerate);
  }
  /* State is on the card and drives the fill through one variable, so the bar
     and any badge beside it read from the same source. */
  .av-kpi--ahead {
    --av-kpi-fill: var(--av-color-success);
  }
  .av-kpi--behind {
    --av-kpi-fill: var(--av-color-danger);
  }
  .av-kpi--at-risk {
    --av-kpi-fill: var(--av-color-warning);
  }
  /* Spotlight card ──────────────────────────────────────────────────── */
  /* A radial highlight that follows the pointer. The position arrives as two
     custom properties set by `initSpotlight`, and defaults to the card's centre
     so the effect is correct before the first pointer event and on a device
     that never sends one. */
  .av-spotlight {
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }
  /* Two things made the first version invisible rather than subtle, and both
     are worth naming because either alone would have been enough.
   *
   * It sat at `--av-z-below` (-1). Combined with `isolation: isolate` on the
   * card, a negative z-index paints *behind* the element's own background —
   * and `.av-card` has an opaque one, so the highlight was drawn and then
   * covered up. It paints at `--av-z-base` now, above the background, with the
   * card's own children lifted above it.
   *
   * It was painted in `--av-glass-bg`, which is
   * `color-mix(--av-surface-raised 78%, transparent)` — a translucent version
   * of the card's *own colour*. Even once visible it would have washed the
   * surface with itself. `--av-highlight-color` is the token for this: the
   * bare `L C H` triplet the inset top highlights already use, so the alpha
   * belongs to the caller. */
  .av-spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: var(--av-z-base);
    pointer-events: none;
    background: radial-gradient(circle at var(--av-spotlight-x, 50%) var(--av-spotlight-y, 50%), oklch(var(--av-highlight-color)/0.16), transparent 55%);
    opacity: 0;
    transition: opacity var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-spotlight:hover::before {
    opacity: 1;
  }
  /* A positioned pseudo-element at z-index 0 paints above in-flow content, so
     without this the highlight washes over the text rather than under it. */
  .av-spotlight > * {
    position: relative;
    z-index: var(--av-z-raised);
  }
  /* A pointer that cannot hover — touch, or a pen — never fires the events the
     module listens for, so the highlight would sit at the default centre and
     read as a rendering artefact rather than an effect. Suppressed rather than
     left showing. */
  @media (hover: none) {
    .av-spotlight::before {
      content: none;
    }
  }
}
@layer components {
  /* Floating action button ──────────────────────────────────────────── */
  /* `position: fixed` against the viewport, not the shell — the shell's only
     scrolling child is `.av-content`, so a FAB positioned inside it would
     scroll away with the page it is meant to float above.
     `inset-inline-end` rather than `right`, so it lands on the trailing edge in
     both directions without a mirrored rule. */
  .av-fab {
    position: fixed;
    inset-block-end: var(--av-space-6);
    inset-inline-end: var(--av-space-6);
    z-index: var(--av-z-sticky);
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-2);
    min-inline-size: var(--av-space-12);
    min-block-size: var(--av-space-12);
    padding-inline: var(--av-space-4);
    justify-content: center;
    border: 0;
    border-radius: var(--av-radius-full);
    background: var(--av-gradient-brand);
    color: var(--av-text-on-primary);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    box-shadow: var(--av-shadow-lg);
    cursor: pointer;
    transition: transform var(--av-duration-fast) var(--av-ease-decelerate), box-shadow var(--av-duration-fast) var(--av-ease-decelerate);
  }
  .av-fab:hover {
    box-shadow: var(--av-shadow-xl);
    transform: translateY(calc(var(--av-lift) * -1));
  }
  /* Icon-only: the padding that made room for a label would otherwise leave an
     off-centre glyph in a pill rather than a circle. */
  .av-fab--icon {
    padding-inline: 0;
  }
  /* The label collapses below the breakpoint so the button becomes a circle on
     a phone, where the thumb reach matters more than the wording. It is hidden
     with `display: none` rather than removed from the DOM, and the button
     carries its own `aria-label`, so the accessible name never depends on the
     viewport. */
  @media (width < 48rem) {
    .av-fab__label {
      display: none;
    }
    /* `inline-size` rather than leaning on the `min-inline-size` above, which
       any ancestor is entitled to flatten: `.av-example__preview > *` sets
       `min-inline-size: 0` for the reason every container that can hold a table
       does, and the label-less button collapsed to **20px wide** on a phone —
       a circle the size of the plus sign inside it, on the very page a buyer
       evaluates the component. A control's own dimensions should not be a
       minimum somebody else can win. */
    .av-fab {
      padding-inline: 0;
      inline-size: var(--av-space-12);
    }
  }
  /* Safe-area inset on a phone with a home indicator, added to the spacing
     rather than replacing it — `env()` is 0 on every other device, so the
     expression is the plain value there. */
  @supports (padding: env(safe-area-inset-bottom)) {
    .av-fab {
      inset-block-end: calc(var(--av-space-6) + env(safe-area-inset-bottom));
    }
  }
}
@layer components {
  /* Popover ─────────────────────────────────────────────────────────── */
  /* A tooltip carries a label; a popover carries content — a heading, prose,
     sometimes a control. That difference is why this is not a tooltip
     modifier: a tooltip is `aria-describedby` on its trigger and must never
     hold anything focusable, and a popover routinely does.

     Like the dropdown menu, it is promoted to the top layer on first open, so
     it escapes both `overflow` clipping and any stacking context a card
     creates with `contain` or a transform. That is why there is no numeric
     z-index here and no `position: fixed` — the top layer has neither. */
  .av-popover {
    /* `:popover-open` is what makes it visible; the closed state is the
       browser's own `display: none` on a popover element, so nothing here
       needs a hidden rule. */
    inline-size: min(20rem, 100vw - var(--av-space-8));
    padding: 0;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-float);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    box-shadow: var(--av-shadow-lg);
    /* The UA stylesheet gives `[popover]` a margin: auto that centres it in the
       viewport — the same rule that centres a <dialog>, and the same surprise.
       The positioning code sets inset explicitly, so the margin has to go. */
    margin: 0;
    opacity: 0;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard), display var(--av-duration-fast) allow-discrete, overlay var(--av-duration-fast) allow-discrete;
  }
  .av-popover:popover-open {
    opacity: 1;
  }
  /* The entry transition needs a starting style, because an element entering
     the top layer has no previous computed value to transition *from* — without
     this it appears at full opacity and the fade only plays on the way out. */
  @starting-style {
    .av-popover:popover-open {
      opacity: 0;
    }
  }
  .av-popover__header {
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-popover__body {
    padding: var(--av-space-3) var(--av-space-4);
  }
}
@layer components {
  /* Gantt ───────────────────────────────────────────────────────────── */
  /* A schedule: one row per task, a bar across the weeks it runs, a fill for
     how much of it is done and a line for today. It is drawn by the stylesheet
     alone. Every bar carries its own numbers as custom properties
     (`--av-gantt-start`, `--av-gantt-span`, `--av-gantt-done`), the chart
     carries the number of columns (`--av-gantt-cols`) and where today falls
     (`--av-gantt-now`), and grid placement does the rest.

     The bars are decoration: each row also says its dates and progress in
     words, which is what a screen reader hears and what a narrow screen shows
     when the bars are too short to read. The chart scrolls sideways inside
     itself, so it is a labelled, focusable region in the markup. */
  .av-gantt {
    --av-gantt-label: calc(var(--av-space-32) * 1.75);
    overflow-x: auto;
  }
  /* The head and the rows are as wide as the chart needs, so the today line's
     percentage is a percentage of the chart and not of the visible part. */
  .av-gantt__head,
  .av-gantt__rows {
    min-inline-size: calc(var(--av-gantt-label) + var(--av-gantt-cols, 8) * var(--av-space-16));
  }
  .av-gantt__head,
  .av-gantt__row {
    display: grid;
    grid-template-columns: var(--av-gantt-label) minmax(0, 1fr);
    align-items: center;
  }
  .av-gantt__head {
    border-block-end: 1px solid var(--av-border-subtle);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-gantt__scale,
  .av-gantt__track {
    display: grid;
    grid-template-columns: repeat(var(--av-gantt-cols, 8), minmax(0, 1fr));
  }
  .av-gantt__scale > * {
    padding: var(--av-space-2);
  }
  .av-gantt__rows {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .av-gantt__row {
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-gantt__row:last-child {
    border-block-end: 0;
  }
  .av-gantt__task {
    display: grid;
    gap: var(--av-space-0-5);
    padding: var(--av-space-3) var(--av-space-4);
    min-inline-size: 0;
  }
  .av-gantt__name {
    font-weight: var(--av-font-weight-medium);
  }
  .av-gantt__meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  /* A line at the start of each week, as one background sized to a column. */
  .av-gantt__track {
    align-items: center;
    align-self: stretch;
    background: linear-gradient(90deg, var(--av-border-subtle) 1px, transparent 1px) 0 0/calc(100% / var(--av-gantt-cols, 8)) 100%;
  }
  .av-gantt__bar {
    --av-gantt-tone: var(--av-color-primary);
    position: relative;
    grid-column: var(--av-gantt-start, 1)/span var(--av-gantt-span, 1);
    block-size: var(--av-space-5);
    margin-inline: var(--av-space-1);
    overflow: hidden;
    background: color-mix(in oklab, var(--av-gantt-tone) 22%, var(--av-surface-raised));
    border-radius: var(--av-radius-full);
  }
  .av-gantt__bar::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: calc(var(--av-gantt-done, 0) * 1%);
    background: var(--av-gantt-tone);
    border-radius: inherit;
  }
  .av-gantt__bar--success {
    --av-gantt-tone: var(--av-color-success);
  }
  .av-gantt__bar--warning {
    --av-gantt-tone: var(--av-color-warning);
  }
  .av-gantt__bar--danger {
    --av-gantt-tone: var(--av-color-danger);
  }
  /* Today: a line down every row, placed in columns from the first. */
  .av-gantt__now {
    position: absolute;
    inset-block: 0;
    inset-inline-start: calc(var(--av-gantt-label) + (100% - var(--av-gantt-label)) * var(--av-gantt-now, 0) / var(--av-gantt-cols, 8));
    inline-size: 2px;
    background: var(--av-color-danger);
    pointer-events: none;
  }
}
@layer components {
  /* Prompt composer ─────────────────────────────────────────────────── */
  /* The box a person writes one message to an assistant in: suggestions, a
     field that grows, and a bar with the model and the send button. The runtime
     (`initPrompt`) sends on Enter and announces the message as an event; what
     answers it is the application's business.

     The field has no outline of its own: the whole box takes the focus ring,
     because the box is what the person is typing into. */
  .av-prompt {
    display: grid;
    gap: var(--av-space-2);
    padding: var(--av-space-3);
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-prompt:focus-within {
    border-color: var(--av-color-primary);
    box-shadow: var(--av-focus-ring);
  }
  .av-prompt__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
  .av-prompt__field {
    inline-size: 100%;
    min-block-size: var(--av-space-10);
    max-block-size: calc(var(--av-space-32) * 1.5);
    padding: var(--av-space-1) var(--av-space-2);
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    resize: none;
    outline: none;
  }
  .av-prompt__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-2);
  }
  .av-prompt__hint {
    margin-inline-end: auto;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* The model picker is as wide as its label, not as wide as the bar. */
  .av-prompt__bar .av-prompt__model {
    inline-size: auto;
  }
  /* Docked at the foot of a conversation, clear of its edges. */
  .av-prompt--docked {
    margin-block: var(--av-space-3) var(--av-space-4);
    margin-inline: var(--av-space-4);
  }
  /* While a reply is arriving the send button gives way to a stop button. */
  .av-prompt__stop {
    display: none;
  }
  .av-prompt[data-av-state=busy] .av-prompt__stop {
    display: inline-flex;
  }
  .av-prompt[data-av-state=busy] .av-prompt__send {
    display: none;
  }
}
@layer components {
  /* Tour ────────────────────────────────────────────────────────────── */
  /* A guided walk across a screen: one card that moves from element to
     element, with a ring on the one it is describing. The runtime (`initTour`)
     builds the card and places it; this is how it looks.

     The page is not dimmed. A dimmed page needs every stepped element lifted
     above the dim, which a card inside a clipped or stacked container cannot
     be, and a ring that always works beats a spotlight that sometimes does. */
  .av-tour {
    position: fixed;
    z-index: var(--av-z-popover);
    display: grid;
    gap: var(--av-space-2);
    inline-size: min(var(--av-space-32) * 2.75, 100vw - var(--av-space-6));
    padding: var(--av-space-4);
    background: var(--av-surface-overlay);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-xl);
  }
  .av-tour__title {
    margin: 0;
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-tour__text {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-tour__foot {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-2);
  }
  .av-tour__count {
    margin-inline-end: auto;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  /* The element the card is describing. The card itself is what a screen
     reader hears: it is a labelled dialog and takes focus at each step. */
  .is-tour-target {
    outline: 2px solid var(--av-color-primary);
    outline-offset: var(--av-space-1);
    border-radius: var(--av-radius-md);
  }
}
@layer components {
  /* Panel ───────────────────────────────────────────────────────────── */
  /* A card without the card. Same border and radius, no elevation and no
     hover, on the sunken surface rather than the raised one — for regions that
     group content *inside* a card, where a second raised surface would imply a
     second level of the page that is not there.

     The distinction is worth a component rather than a card modifier because
     the two nest: a panel inside a card is the common case, and
     `.av-card--flat` inside `.av-card` would read as a mistake. */
  .av-panel {
    padding: var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
  }
  .av-panel--flush {
    padding: 0;
  }
  .av-panel__title {
    margin-block: 0 var(--av-space-2);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  /* Pricing card ────────────────────────────────────────────────────── */
  .av-pricing-card {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-4);
    padding: var(--av-space-6);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
  }
  /* The featured tier is marked with the brand gradient in the border area,
     using the same two-background technique as `.av-border-gradient` —
     `border-image` does not follow `border-radius`, so a rounded gradient
     border loses its corners. Repeated rather than composed because a pricing
     card sets its own surface and radius, and inheriting them from a utility
     would couple the two. */
  .av-pricing-card--featured {
    background: linear-gradient(var(--av-surface-raised), var(--av-surface-raised)) padding-box, var(--av-gradient-brand) border-box;
    border-color: transparent;
  }
  /* The billing-page states live here beside the component rather than in
     `components/_plans.scss`, because two partials declaring `.av-pricing-card`
     land in one layer at the same specificity and `@use` order decides the
     winner. `lint-css.mjs` fails on that now. */
  /* The tier you are on. Marked with a border and a ribbon rather than by
     hiding its button: a plan you cannot re-select is a plan you cannot see
     the price of, and "Current plan" as a disabled button says both things. */
  .av-pricing-card[data-av-state=current] {
    border-color: var(--av-color-primary);
    box-shadow: var(--av-focus-ring);
  }
  .av-pricing-card__ribbon {
    align-self: flex-start;
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-on-primary);
    background: var(--av-color-primary);
    border-radius: var(--av-radius-full);
    padding: 2px var(--av-space-2-5);
  }
  .av-pricing-card__name {
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wide);
    text-transform: uppercase;
    color: var(--av-text-muted);
  }
  .av-pricing-card__price {
    display: flex;
    align-items: baseline;
    gap: var(--av-space-1);
    margin: 0;
    font-size: var(--av-font-size-4xl);
    font-weight: var(--av-font-weight-bold);
    /* Tabular figures so the tiers line up across a row of cards: proportional
       digits make "9" and "49" sit at different heights of ink and the row
       reads as though it is not aligned. */
    font-variant-numeric: tabular-nums lining-nums;
    color: var(--av-text-primary);
  }
  .av-pricing-card__period {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-muted);
  }
  /* The line under the price that says who the tier is for. */
  .av-pricing-card__note {
    margin: var(--av-space-2) 0 var(--av-space-4);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-pricing-card__features {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-pricing-card__features li {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
  }
  /* Pushes the call to action to the bottom edge whatever the feature count,
     so a row of tiers has its buttons on one line. */
  .av-pricing-card__cta {
    margin-block-start: auto;
  }
  /* The flag on a featured plan. `align-self` because the card is a flex
     column, where the default `stretch` makes a badge span the full width and
     stop looking like a badge. */
  .av-pricing-card__flag {
    align-self: flex-start;
  }
}
@layer components {
  /* Spinner ─────────────────────────────────────────────────────────── */
  /* Named `.av-spinner`, not Bootstrap's `.spinner-border`.
     `currentColor` on three of the four border edges means the spinner takes
     the colour of whatever it sits in — inside a primary button it is the
     label colour, inside a muted cell it is the muted text — with no modifier
     and no second token to keep in step. */
  .av-spinner {
    display: inline-block;
    inline-size: var(--av-space-5);
    block-size: var(--av-space-5);
    border: 2px solid currentColor;
    border-block-start-color: transparent;
    border-radius: var(--av-radius-full);
    animation: av-spinner-turn var(--av-duration-slower) linear infinite;
    /* A spinner is decoration; the state it reports belongs to a live region
       or the control's own accessible name. Left announced, a screen reader
       gets nothing from it and a busy button says nothing at all. */
    vertical-align: -0.125em;
  }
  .av-spinner--sm {
    inline-size: var(--av-space-3-5);
    block-size: var(--av-space-3-5);
    border-width: 1.5px;
  }
  .av-spinner--lg {
    inline-size: var(--av-space-8);
    block-size: var(--av-space-8);
    border-width: 3px;
  }
  /* Direction is *not* flipped under RTL. A spinner is not a directional
     affordance — it does not point anywhere or imply travel — and mirroring it
     makes the one control on the page that turns the other way, which reads as
     a bug rather than a translation. Progress bars mirror; clocks do not. */
  @keyframes av-spinner-turn {
    to {
      rotate: 360deg;
    }
  }
}
@layer components {
  /* Dot badge ───────────────────────────────────────────────────────── */
  /* A count badge with no count: "there is something here". Used on the
     notification bell and on sidebar rows where a number would be noise.

     It is `aria-hidden` in the markup and the meaning is carried by the
     control's accessible name, for the same reason the notification badge is:
     a reader that picks up a bare dot announces nothing useful, and one that
     picks up a digit announces a number with no noun attached. */
  .av-dot {
    display: inline-block;
    inline-size: var(--av-space-2);
    block-size: var(--av-space-2);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
  }
  .av-dot--success {
    background: var(--av-color-success);
  }
  .av-dot--warning {
    background: var(--av-color-warning);
  }
  .av-dot--danger {
    background: var(--av-color-danger);
  }
  .av-dot--info {
    background: var(--av-color-info);
  }
  .av-dot--neutral {
    background: var(--av-color-neutral);
  }
  /* Status dot ──────────────────────────────────────────────────────── */
  /* The presence indicator that used to live inside the chat partial, where
     "online" was the only state that screen needed. Pulled out here with the
     other three, so a contact list and a user menu can use it without
     importing chat.

     The ring is a border in the *surface* colour rather than a box-shadow:
     over an avatar the dot needs to punch a hole in the image, and a border
     participating in the border-box does that while a shadow paints over the
     top and shifts with any transform on the parent. */
  .av-status-dot {
    display: inline-block;
    inline-size: var(--av-space-2-5);
    block-size: var(--av-space-2-5);
    border: 2px solid var(--av-surface-raised);
    border-radius: var(--av-radius-full);
    background: var(--av-color-neutral);
    box-sizing: content-box;
  }
  .av-status-dot--online {
    background: var(--av-color-success);
  }
  .av-status-dot--away {
    background: var(--av-color-warning);
  }
  .av-status-dot--busy {
    background: var(--av-color-danger);
  }
  .av-status-dot--offline {
    background: var(--av-color-neutral);
  }
}
@layer components {
  /* Vitals strip ────────────────────────────────────────────────────────
     A row of small live readings in the topbar's free middle: server load,
     memory, disk, people online, queued jobs. Each reading is a link to the
     page that explains it, so the strip is a way in, not a dashboard.

     It fills whatever room the topbar has, and that room depends on the
     sidebar posture as much as on the viewport, so the strip is a *container*
     and every decision below asks the container, not the window:

       - under 15rem not even two readings fit, so the list hides and one
         summary button (a health dot) opens the details in a drawer;
       - `--secondary` readings join from 27rem, `--tertiary` from 40rem.

     The author orders the readings and marks which can go first; the strip
     never measures text, so nothing jumps while the numbers change. A
     reading that needs attention should drop its tier, so a warning is never
     the reading that got hidden. */
  .av-vitals {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-inline-size: 0;
    container: av-vitals/inline-size;
  }
  /* One row, always. Readings that would not fit wrap onto a second row
     that the list clips, so a reading is shown whole or not at all, and the
     strip can never spill over the search field beside it. The block padding
     keeps the focus ring inside the clip; the wide row gap keeps the second
     row out of it. */
  .av-vitals__list {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--av-space-6) var(--av-space-1-5);
    min-inline-size: 0;
    max-inline-size: 100%;
    max-block-size: calc(30px + 2 * var(--av-space-1));
    margin: 0;
    padding: var(--av-space-1);
    overflow: hidden;
    list-style: none;
  }
  .av-vitals__entry {
    display: flex;
  }
  /* A reading that needs attention moves to the front, so when the row runs
     out of room it is never the one that wrapped out of sight. */
  .av-vitals__entry:has(.av-vitals__item--warning, .av-vitals__item--danger) {
    order: -1;
  }
  /* One reading. A link when it leads somewhere, a span when it does not. */
  .av-vitals__item {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    min-block-size: 30px;
    padding-inline: var(--av-space-2-5);
    /* Quiet at rest: no pill border or fill, so five readings read as one
       calm strip rather than five buttons. A reading that needs attention
       still draws its border in the role colour (the modifiers below). */
    border: 1px solid transparent;
    border-radius: var(--av-radius-full);
    background: transparent;
    /* The label stays secondary rather than muted, as it was on the old
       sunken fill. */
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  a.av-vitals__item:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-vitals__value {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums lining-nums;
  }
  /* A share of a whole (memory, disk) can carry a small bar. The fill is a
     per-instance value, 0 to 100, set as `--av-vitals-value`. */
  .av-vitals__meter {
    position: relative;
    inline-size: var(--av-space-6);
    block-size: var(--av-space-1);
    overflow: hidden;
    border-radius: var(--av-radius-full);
    background: var(--av-border-default);
  }
  .av-vitals__meter::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: calc(var(--av-vitals-value, 0) * 1%);
    border-radius: inherit;
    background: var(--av-color-primary);
    transition: inline-size var(--av-duration-normal) var(--av-ease-standard);
  }
  /* The state is a modifier on the reading, so one place decides what
     "high" looks like: border, number and bar move together. */
  .av-vitals__item--warning {
    border-color: var(--av-color-warning);
  }
  .av-vitals__item--warning .av-vitals__value {
    color: var(--av-color-warning-text);
  }
  .av-vitals__item--warning .av-vitals__meter::after {
    background: var(--av-color-warning);
  }
  .av-vitals__item--danger {
    border-color: var(--av-color-danger);
  }
  .av-vitals__item--danger .av-vitals__value {
    color: var(--av-color-danger-text);
  }
  .av-vitals__item--danger .av-vitals__meter::after {
    background: var(--av-color-danger);
  }
  /* The narrow form: one button whose dot is the worst state in the strip,
     opening a drawer with every reading. Its accessible name says the state
     in words; the dot is decoration. */
  .av-vitals__summary {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    min-block-size: 38px;
    padding-inline: var(--av-space-2);
    border: 0;
    border-radius: var(--av-radius-md);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    white-space: nowrap;
  }
  .av-vitals__summary:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-vitals__entry--secondary,
  .av-vitals__entry--tertiary {
    display: none;
  }
  @container av-vitals (min-width: 15rem) {
    .av-vitals__list {
      display: flex;
    }
    .av-vitals__summary {
      display: none;
    }
  }
  @container av-vitals (min-width: 27rem) {
    .av-vitals__entry--secondary {
      display: flex;
    }
  }
  @container av-vitals (min-width: 40rem) {
    .av-vitals__entry--tertiary {
      display: flex;
    }
  }
}
@layer components {
  /* Player bar ───────────────────────────────────────────────────────────
     An audio (or podcast, or voice note) player docked under the page: what
     is playing, the transport, a seek bar with the times, and volume. It is
     markup and styles only; the app owns the <audio> element and sets the
     state classes and `--av-range-fill` on the two ranges, so the bar works
     the same in any framework and never fights a re-render.

     It is the last row of `.av-main` (see layout/shell), not `position:
     fixed`, so it spans exactly the content column whatever the sidebar is
     doing, and the page above it scrolls in the room that is left instead of
     hiding its last lines under the bar.

     It is a container, and the layout asks the container, not the window:
       - from 48rem everything is in one row: media, transport and seek in the
         middle, volume and actions at the end;
       - below that the seek bar becomes its own row under the media and the
         transport keeps play, previous and next; volume and `--secondary`
         controls hide (the device has its own volume);
       - `.is-minimised` keeps only the media and the play button. */
  .av-player {
    grid-area: player;
    container: av-player/inline-size;
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
    box-shadow: var(--av-shadow-sm);
  }
  .av-player__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "media transport" "seek seek";
    align-items: center;
    gap: var(--av-space-2) var(--av-space-3);
    padding: var(--av-space-2) var(--av-content-padding);
  }
  @container av-player (width >= 48rem) {
    .av-player__inner {
      grid-template-columns: minmax(10rem, 1fr) minmax(0, 2fr) minmax(0, 1fr);
      grid-template-areas: "media centre aside";
      gap: var(--av-space-4);
    }
  }
  /* What is playing: a cover and two lines that truncate, never wrap, so the
     bar keeps its height while titles change. */
  .av-player__media {
    grid-area: media;
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    min-inline-size: 0;
    --av-thumb-size: 44px;
  }
  .av-player__text {
    display: grid;
    min-inline-size: 0;
  }
  .av-player__title,
  .av-player__subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-player__title {
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-player__subtitle {
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
  }
  /* The middle column holds the transport over the seek bar on a wide bar;
     on a narrow one `display: contents` lets both join the outer grid as
     their own areas, so the markup is the same at every width. */
  .av-player__centre {
    display: contents;
  }
  @container av-player (width >= 48rem) {
    .av-player__centre {
      grid-area: centre;
      display: grid;
      justify-items: center;
      gap: var(--av-space-1);
      min-inline-size: 0;
    }
  }
  .av-player__transport {
    grid-area: transport;
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
  }
  @container av-player (width >= 48rem) {
    .av-player__transport {
      grid-area: auto;
    }
  }
  .av-player__seek {
    grid-area: seek;
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    inline-size: 100%;
    min-inline-size: 0;
  }
  @container av-player (width >= 48rem) {
    .av-player__seek {
      grid-area: auto;
    }
  }
  /* Tabular figures, and room for "00:00", so the seek bar never shifts as
     the seconds tick over. */
  .av-player__time {
    min-inline-size: 5ch;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    font-variant-numeric: tabular-nums;
    text-align: center;
  }
  .av-player__aside {
    grid-area: aside;
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: var(--av-space-1);
    min-inline-size: 0;
  }
  @container av-player (width >= 48rem) {
    .av-player__aside {
      display: flex;
    }
  }
  .av-player__volume {
    inline-size: 6rem;
    flex: 0 1 auto;
  }
  /* Controls that only make sense with room: shuffle, repeat, the queue. */
  .av-player__control--secondary {
    display: none;
  }
  @container av-player (width >= 48rem) {
    .av-player__control--secondary {
      display: inline-flex;
    }
  }
  /* A toggle that is on (shuffle, repeat) reads as pressed, in the primary
     colour, and says so to assistive tech through `aria-pressed`. */
  .av-player__control[aria-pressed=true] {
    color: var(--av-color-primary);
  }
  /* Minimised: the media and play only, in one short row. */
  .av-player.is-minimised .av-player__inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "media transport aside";
  }
  .av-player.is-minimised :is(.av-player__seek, .av-player__control--step, .av-player__control--secondary, .av-player__volume) {
    display: none;
  }
  .av-player.is-minimised .av-player__centre {
    display: contents;
  }
  .av-player.is-minimised .av-player__transport {
    grid-area: transport;
  }
  .av-player.is-minimised .av-player__aside {
    display: flex;
  }
}
@layer components {
  /* Button group ────────────────────────────────────────────────────── */
  .av-btn-group {
    display: inline-flex;
    /* Not a gap: the buttons share edges, and a gap would put the page ground
       between them. The overlap below is what keeps the shared edge one pixel
       rather than two. */
    isolation: isolate;
  }
  .av-btn-group > .av-btn {
    border-radius: 0;
    /* Pull each button back onto its neighbour's border so the seam is a
       single rule. Without this, two 1px borders meet and the divider is
       visibly heavier than the group's outer edge. */
    margin-inline-start: -1px;
  }
  .av-btn-group > .av-btn:first-child {
    margin-inline-start: 0;
  }
  /* Logical radius properties, so the group rounds its outer edges under RTL
     without a mirrored rule. `border-start-start` is top-left in LTR and
     top-right in RTL, which is exactly what "the group's leading corner"
     means. */
  .av-btn-group > .av-btn:first-child {
    border-start-start-radius: var(--av-radius-md);
    border-end-start-radius: var(--av-radius-md);
  }
  .av-btn-group > .av-btn:last-child {
    border-start-end-radius: var(--av-radius-md);
    border-end-end-radius: var(--av-radius-md);
  }
  /* A focused or pressed button has to come forward, or its focus ring is
     clipped by the neighbour overlapping it — the ring is drawn outside the
     border box and the next button is painted after it. */
  .av-btn-group > .av-btn:is(:hover, :focus-visible, [aria-pressed=true]) {
    z-index: var(--av-z-raised);
  }
  /* A split button is a group whose last member is a dropdown toggle. The
     dropdown wrapper is a positioning context, so it has to participate in the
     group's flex layout rather than sit inside a button. */
  .av-btn-group > .av-dropdown {
    display: inline-flex;
  }
  .av-btn-group > .av-dropdown > .av-btn {
    border-radius: 0;
    border-start-end-radius: var(--av-radius-md);
    border-end-end-radius: var(--av-radius-md);
    margin-inline-start: -1px;
    /* The toggle is a caret and nothing else, so it does not need the label
       padding a normal button carries. */
    padding-inline: var(--av-space-2);
  }
  /* Toggle button ───────────────────────────────────────────────────── */
  /* State lives in `aria-pressed`, not in a class. The attribute is what a
     screen reader announces, and driving the styling from the same source
     means the two can never disagree — the coding standards require ARIA to be
     updated alongside every state change, and this removes the second thing to
     remember.

     Bootstrap does this with a visually-hidden `.btn-check` input, which needs
     a sibling label and a matching id per control. A real <button> with
     aria-pressed needs neither. */
  .av-btn-toggle[aria-pressed=true] {
    background: var(--av-color-primary-subtle);
    border-color: var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  .av-btn-toggle[aria-pressed=true]:hover {
    background: var(--av-color-primary-subtle);
    border-color: var(--av-color-primary);
  }
}
@layer components {
  /* Avatar ────────────────────────────────────────────────────────────────
     Initials by default rather than an image: no second request, no broken-image
     state, and no layout shift when the request is slow. An `<img>` dropped
     inside still works — the box clips it.

     These rules were spread across three files, because the avatar was first
     needed in the topbar, then the customer card, then chat. Nothing about it
     belongs to any of those. Gathering it here is the difference between a
     component and a coincidence, and it is the reason `--status` could only ever
     say "online": the presence dot lived in the chat partial, where one state
     was all that screen used. */
  .av-avatar {
    display: inline-grid;
    place-items: center;
    inline-size: 36px;
    block-size: 36px;
    flex: none;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    overflow: hidden;
    user-select: none;
  }
  .av-avatar img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  .av-avatar--sm {
    inline-size: 28px;
    block-size: 28px;
    font-size: var(--av-font-size-2xs);
  }
  .av-avatar--lg {
    inline-size: 48px;
    block-size: 48px;
    font-size: var(--av-font-size-base);
  }
  .av-avatar--xl {
    inline-size: 88px;
    block-size: 88px;
    font-size: var(--av-font-size-2xl);
    box-shadow: 0 0 0 4px var(--av-surface-raised), 0 0 0 6px var(--av-color-primary-border);
    margin-block-end: var(--av-space-4);
  }
  /* Presence. The dot is decorative — the state has to be in text somewhere the
     reader can reach, because a colour is not an accessible name.

     `overflow: visible` is load-bearing and it was missing. The dot is a
     pseudo-element hung *outside* the disc by a pixel on each axis, and the
     `overflow: hidden` above — which is there to round an `<img>` — was cutting
     it into a wedge. It read as a rendering artefact rather than as a status,
     and it did so everywhere an avatar carried one: the rail, the chat header,
     the contact list. Turning containment off for this modifier means the image
     has to round itself, which is one line and is what a photo should have been
     doing regardless. */
  .av-avatar--status {
    position: relative;
    overflow: visible;
  }
  .av-avatar--status img {
    border-radius: var(--av-radius-full);
  }
  .av-avatar--status::after {
    content: "";
    position: absolute;
    inset-block-end: -1px;
    inset-inline-end: -1px;
    inline-size: 9px;
    block-size: 9px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-success);
    border: 2px solid var(--av-surface-raised);
  }
  .av-avatar[data-av-status=away]::after {
    background: var(--av-color-warning);
  }
  .av-avatar[data-av-status=busy]::after {
    background: var(--av-color-danger);
  }
  .av-avatar[data-av-status=offline]::after {
    background: var(--av-border-strong);
  }
  /* Overlapping group, for "and four others". Each avatar is punched out of the
     one before it with a ring in the page's own ground colour, so the stack
     reads as separate discs rather than a smear. */
  .av-avatar-group {
    display: inline-flex;
    align-items: center;
  }
  .av-avatar-group .av-avatar {
    margin-inline-start: calc(var(--av-space-2) * -1);
    box-shadow: 0 0 0 2px var(--av-surface-raised);
  }
  .av-avatar-group .av-avatar:first-child {
    margin-inline-start: 0;
  }
  .av-avatar-group__more {
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
  }
}
@layer components {
  /* Avatar upload and crop ──────────────────────────────────────────────
     A dropzone that becomes a cropper. The two are one dialog rather than two
     steps, because "choose" and "frame" are one decision — a wizard here means
     going back to change your mind about a photograph you have already
     accepted. */
  .av-avatar-upload {
    display: grid;
    gap: var(--av-space-4);
  }
  /* The dropzone ───────────────────────────────────────────────────────
     The whole panel is a `<label>`, so the click target is the rectangle and
     not the sentence inside it — and the file input keeps its own focus ring
     rather than being replaced by a button that opens it, which is a control
     the keyboard can reach and a screen reader announces correctly for free. */
  .av-avatar-drop {
    display: grid;
    place-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-8) var(--av-space-6);
    border: 1px dashed var(--av-border-strong);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-avatar-drop:hover,
  .av-avatar-drop.is-over {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
  }
  /* `:focus-within`, because the ring belongs on the panel while focus is on
     the input inside it — the narrowing `lint-css.mjs`'s no-outline-none rule
     already permits, and the same arrangement as the datagrid toolbar. */
  .av-avatar-drop:focus-within {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  .av-avatar-drop[aria-invalid=true] {
    border-color: var(--av-color-danger);
  }
  .av-avatar-drop__icon {
    inline-size: var(--av-space-8);
    block-size: var(--av-space-8);
    color: var(--av-text-muted);
  }
  .av-avatar-drop__title {
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-avatar-drop__hint {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* The input is off-screen rather than `display: none`: a hidden control is
     not focusable, so the label would take focus and the ring would sit on a
     panel nothing could activate from the keyboard. */
  .av-avatar-drop input[type=file] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  /* The editor ─────────────────────────────────────────────────────────── */
  .av-avatar-editor {
    display: grid;
    gap: var(--av-space-4);
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  @media (max-width: 640px) {
    .av-avatar-editor {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  /* The stage, its zoom and its actions are one column with one gap, rather
     than three `margin-block-start` values written inline on the markup. An
     inline `style=` is invisible to every gate this repository owns — outside
     every `@layer`, answering to no specificity ceiling, past the tokens-only
     rule — which is exactly how eight of them held the shop home together. */
  .av-avatar-editor__main {
    display: grid;
    gap: var(--av-space-3);
    min-inline-size: 0;
    justify-items: center;
  }
  .av-avatar-actions {
    inline-size: 100%;
    max-inline-size: 320px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    min-inline-size: 0;
  }
  /* Capped, and this is the whole layout. A square stage told only to fill its
     column grows with the dialog: at `--lg` that is a 628px circle, the dialog
     runs past the viewport, and the zoom slider and the rotate buttons — the
     only controls a cropper has — end up below the fold of a scrolling body.
     A cropper whose controls you have to scroll to find is a picture of a
     cropper. 320px is enough to frame a face accurately and leaves the whole
     dialog on screen at 900px tall, which is the shortest laptop this template
     is designed against. */
  .av-avatar-stage {
    position: relative;
    inline-size: 100%;
    max-inline-size: 320px;
    aspect-ratio: 1;
    border-radius: var(--av-radius-lg);
    overflow: hidden;
    /* The ground behind a photograph, for the same reason the lightbox has
       one: letterboxing is meant to disappear, and a pale well around an image
       reads as a rendering fault rather than as a frame. */
    background: var(--av-media-well);
    touch-action: none;
  }
  .av-avatar-stage canvas {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    cursor: grab;
  }
  .av-avatar-stage canvas:active {
    cursor: grabbing;
  }
  .av-avatar-stage canvas:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: calc(var(--av-focus-offset) * -2);
  }
  /* The mask is a ring drawn *over* the canvas rather than a clip applied to
     it, so the reader can see what falls outside the crop and drag it in. A
     cropper that hides the rest of the photograph is asking someone to aim at
     something they cannot see. `pointer-events: none` keeps it out of the way
     of the drag it sits on top of. */
  .av-avatar-stage__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: oklch(var(--av-shadow-color)/0.55);
    /* Two circles, one ring: the even-odd rule of a single path is not
       available to `clip-path: circle()`, so the hole is cut with a radial
       gradient mask instead. `closest-side` ties the circle to the shorter
       edge, which is the same edge the crop maths uses. */
    mask-image: radial-gradient(circle closest-side at 50% 50%, transparent 99%, black 100%);
    -webkit-mask-image: radial-gradient(circle closest-side at 50% 50%, transparent 99%, black 100%);
  }
  .av-avatar-stage__ring {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: var(--av-radius-full);
    box-shadow: inset 0 0 0 2px oklch(var(--av-highlight-color)/0.7);
  }
  .av-avatar-tools {
    display: grid;
    gap: var(--av-space-2);
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    inline-size: 100%;
    max-inline-size: 320px;
  }
  .av-avatar-tools__icon {
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
    color: var(--av-text-muted);
  }
  /* Live previews at the sizes the avatar is actually used, because "does this
     read at 32px" is the only question a crop has to answer and it cannot be
     answered from a 320px stage. */
  .av-avatar-previews {
    display: grid;
    gap: var(--av-space-3);
    justify-items: center;
    align-content: start;
    padding: var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
  }
  .av-avatar-previews canvas {
    display: block;
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
  }
  .av-avatar-previews__label {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
    text-align: center;
  }
  .av-avatar-upload__status {
    margin: 0;
    min-block-size: var(--av-space-5);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-avatar-upload__status.is-error {
    color: var(--av-color-danger-text);
  }
  .av-avatar-upload__file {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@layer components {
  /* Stat card ───────────────────────────────────────────────────────── */
  /* The tile is drawn from the preset's KPI recipe (`--av-kpi-*`, see KPIS in
     tools/presets.mjs): how much of its colour fills the tile and tints its
     edge, how strong a glow it casts, and whether it carries the accent bar.
     The recipe is numbers on <html>; the colour is resolved here, per tile, so
     each tile in a row tints with its own series. `data-av-depth="plain"`
     restores the quiet outline tile whatever the preset says. */
  .av-stat-card {
    --av-stat-tone: var(--av-stat-role, var(--av-stat-accent, var(--av-stat-series, var(--av-color-primary))));
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--av-space-2);
    padding: var(--av-space-5);
    background: color-mix(in oklab, var(--av-stat-tone) var(--av-kpi-fill), var(--av-surface-raised));
    border: 1px solid color-mix(in oklab, var(--av-stat-tone) var(--av-kpi-edge), var(--av-border-subtle));
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm), 0 14px 32px -16px oklch(from var(--av-stat-tone) l c h/var(--av-kpi-glow));
    overflow: hidden;
    transition: box-shadow var(--av-duration-normal) var(--av-ease-standard), border-color var(--av-duration-normal) var(--av-ease-standard), translate var(--av-duration-normal) var(--av-ease-standard);
  }
  [data-bs-theme=dark] .av-stat-card {
    box-shadow: 0 1px 3px 0 oklch(var(--av-shadow-color)/0.4), inset 0 1px 0 0 oklch(var(--av-highlight-color)/0.04), 0 14px 32px -16px oklch(from var(--av-stat-tone) l c h/var(--av-kpi-glow));
  }
  /* Accent bar along the top edge. It is the single strongest cue that these
     four tiles are a set of related figures rather than four loose boxes, and
     the role modifier on the icon drives its colour so the two cannot disagree. */
  .av-stat-card::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: var(--av-kpi-bar);
    background: var(--av-stat-accent, var(--av-stat-series, var(--av-gradient-brand)));
  }
  /* ── The series: a tile's colour by its place in the row ──────────────
     Four tiles are four figures, and they used to be told apart with the
     status roles: `info`, `warning` and `success` as decoration, which is
     fixed sky, amber and green on every preset. Three tiles in four ignored
     the theme on every dashboard, and "Completed" was a warning.

     So a tile reads its colour from its position, from `--av-tile-1..4`, which
     the token build derives from the preset's own chart wheel (tile 1 is the
     primary). It is a **fallback** in every chain below, never an assignment:
     a stated role (`--av-stat-role`, `--av-stat-accent`) still wins, so the
     tile that really is a danger stays red. `:nth-child` counts siblings, so a
     row of three gets tiles 1 to 3 and a row of eight repeats the four. */
  .av-stat-card:nth-child(4n+1) {
    --av-stat-series: var(--av-tile-1);
  }
  .av-stat-card:nth-child(4n+2) {
    --av-stat-series: var(--av-tile-2);
  }
  .av-stat-card:nth-child(4n+3) {
    --av-stat-series: var(--av-tile-3);
  }
  .av-stat-card:nth-child(4n+4) {
    --av-stat-series: var(--av-tile-4);
  }
  .av-stat-card:has(.av-stat-card__icon--success) {
    --av-stat-accent: var(--av-color-success);
  }
  .av-stat-card:has(.av-stat-card__icon--warning) {
    --av-stat-accent: var(--av-color-warning);
  }
  .av-stat-card:has(.av-stat-card__icon--info) {
    --av-stat-accent: var(--av-color-info);
  }
  /* `danger` existed as a role everywhere else and was missing here, so a card
     for refunds or failures fell back to the brand accent and read as neutral. */
  .av-stat-card:has(.av-stat-card__icon--danger) {
    --av-stat-accent: var(--av-color-danger);
  }
  /* The role, said on the card rather than inferred from its icon.
     `:has()` on the icon is the convenient form and it only works for a card
     that *has* an icon — six of the ten dashboards carry a label and a figure
     and nothing else, so every one of their tiles fell back to the brand hue
     and a row of four read as one repeated metric. The role is a property of
     the number, not of whether somebody drew a glyph for it. */
  .av-stat-card--success {
    --av-stat-accent: var(--av-color-success);
    --av-stat-role: var(--av-color-success);
  }
  .av-stat-card--warning {
    --av-stat-accent: var(--av-color-warning);
    --av-stat-role: var(--av-color-warning);
  }
  .av-stat-card--info {
    --av-stat-accent: var(--av-color-info);
    --av-stat-role: var(--av-color-info);
  }
  .av-stat-card--danger {
    --av-stat-accent: var(--av-color-danger);
    --av-stat-role: var(--av-color-danger);
  }
  /* ══ Vivid — the tile carries the role colour ═══════════════════════
     Four surface-coloured rectangles with a hairline accent bar is a correct
     KPI row and a forgettable one: the directive's own words for what to avoid
     are "a field of equally weighted grey rectangles". The vivid modifier hands
     the tile the role colour outright, which is the single strongest way to
     make the top of a dashboard legible at a glance — each metric is
     identifiable by hue before a word is read.

     Three things make it safe rather than merely loud:

     **The fill is deepened, and that is a correctness fix rather than a taste
     one.** The obvious implementation paints the role token as-is and picks
     white or near-black against it. Measured across the roles, that cannot
     work: `success` at its light-mode step scores **4.31:1 against white and
     3.82:1 against near-black** — no ink clears 4.5 on it, because the colour
     sits at the mid lightness where both inks are equally poor. `info` lands in
     the same trap at 4.4. So the tile clamps lightness with `min(l, .42)`: deep
     enough that white always has headroom, which is also what the reference
     dashboards this was drawn from actually do — their vivid tiles are deep,
     not mid.

     **The ink is therefore white by construction, and the gate proves it** at
     every stop rather than at the mid one. `--av-gradient-brand` already
     documents the failure this avoids: ink chosen against a mid stop while the
     ends wander, passing a token-level check and failing on screen. The
     excursion is a deliberate ±.04 and `tests/contrast.mjs` resolves all three
     stops through the browser and takes the worst.

     **It is opt-in.** A vivid tile says "this number matters"; sixteen of them
     on one screen says nothing at all. */
  .av-stat-card--vivid {
    /* A **fallback**, not an assignment. Declaring `--av-stat-role` here would
       sit beside the 0-1-0 role modifiers and win or lose on source order
       (`.av-stat-card--info`), quietly painting every tile the brand hue — which
       is exactly what it did: four identically blue tiles on the six dashboards
       whose cards carry a role and no icon. Reading the role with a default
       leaves the modifier as the only thing that sets it, so specificity never
       enters into it. */
    --av-stat-fill: oklch(from var(--av-stat-role, var(--av-stat-series, var(--av-color-primary))) min(l, .42) c h);
    --av-stat-ink: var(--av-neutral-0);
    background: linear-gradient(135deg, oklch(from var(--av-stat-fill) calc(l + 0.04) c h) 0%, var(--av-stat-fill) 55%, oklch(from var(--av-stat-fill) calc(l - 0.04) c h) 100%);
    border-color: transparent;
    color: var(--av-stat-ink);
    box-shadow: var(--av-shadow-md), 0 14px 34px -14px oklch(from var(--av-stat-fill) l c h/0.5), inset 0 1px 0 0 oklch(var(--av-highlight-color)/0.2);
  }
  /* Only the *role* changes; the deepening and the ink are inherited from the
     block above, so a new role is one line and cannot forget either. */
  .av-stat-card--vivid:has(.av-stat-card__icon--success) {
    --av-stat-role: var(--av-color-success);
  }
  .av-stat-card--vivid:has(.av-stat-card__icon--warning) {
    --av-stat-role: var(--av-color-warning);
  }
  .av-stat-card--vivid:has(.av-stat-card__icon--info) {
    --av-stat-role: var(--av-color-info);
  }
  .av-stat-card--vivid:has(.av-stat-card__icon--danger) {
    --av-stat-role: var(--av-color-danger);
  }
  /* The accent bar is the flat card's way of saying which role this is. On a
     vivid tile the whole surface says it, so the bar is a stripe of almost the
     same colour sitting on top of itself. */
  .av-stat-card--vivid::before {
    content: none;
  }
  /* Every descendant that carried its own colour has to hand it back, or the
     muted label and the green trend chip stay legible against the page ground
     they were designed for and not against this one. */
  .av-stat-card--vivid .av-stat-card__label,
  .av-stat-card--vivid .av-stat-card__value,
  .av-stat-card--vivid .av-stat-card__foot,
  .av-stat-card--vivid .av-trend {
    color: inherit;
  }
  .av-stat-card--vivid .av-stat-card__label,
  .av-stat-card--vivid .av-stat-card__foot {
    opacity: 0.82;
  }
  /* A translucent chip rather than a token background: it has to read against
     whichever role fills the tile. Derived from `--av-stat-ink` rather than
     `currentColor` — the two resolve identically here, but only one of them is
     a token the linter can follow, and a rule that reads as a raw colour is
     worth avoiding even when it is not one. */
  .av-stat-card--vivid .av-stat-card__icon {
    background: oklch(from var(--av-stat-ink) l c h/0.16);
    color: inherit;
  }
  .av-stat-card--vivid:hover .av-stat-card__icon {
    box-shadow: none;
  }
  .av-stat-card--vivid:hover {
    border-color: transparent;
    box-shadow: var(--av-shadow-lg), 0 20px 44px -14px oklch(from var(--av-stat-fill) l c h/0.62), inset 0 1px 0 0 oklch(var(--av-highlight-color)/0.24);
  }
  /* ── Spotlight ─────────────────────────────────────────────────────────
     Every tile lights up under the pointer, in its own colour. `initSpotlight`
     writes the position; the centre is the default, so a tile that has never
     seen a pointer is still drawn correctly. A vivid tile is already its own
     colour, so it is lit with the highlight instead. */
  .av-stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--av-spotlight-x, 50%) var(--av-spotlight-y, 50%), color-mix(in oklab, var(--av-stat-tone) 16%, transparent), transparent 60%);
    opacity: 0;
    transition: opacity var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-stat-card--vivid::after {
    background: radial-gradient(circle at var(--av-spotlight-x, 50%) var(--av-spotlight-y, 50%), oklch(var(--av-highlight-color)/0.16), transparent 60%);
  }
  .av-stat-card:hover::after {
    opacity: 1;
  }
  /* A pointer that cannot hover never moves the light, so it is not drawn. */
  @media (hover: none) {
    .av-stat-card::after {
      content: none;
    }
  }
  /* ── Hero: the one figure the row is about ─────────────────────────────
     A row of equal tiles has nowhere for the eye to land. The hero is a vivid
     tile (it carries `--vivid` too, so the fill and its ink are the measured
     ones) with a display-size figure and a slow sheen crossing it. One per
     row, first in the row; `.av-grid--lead` gives it the wider track. */
  .av-stat-card--hero .av-stat-card__value {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-4xl);
  }
  /* The sheen is a band in an oversized background that slides across, not a
     translated box: a background position has no direction to mirror. */
  .av-stat-card--hero::after {
    content: "";
    background: linear-gradient(105deg, transparent 40%, oklch(var(--av-highlight-color)/0.2) 50%, transparent 60%) 100% 0/250% 100% no-repeat;
    opacity: 1;
    animation: stat-card-sheen 7s var(--av-ease-standard) 2s infinite;
  }
  @keyframes stat-card-sheen {
    0% {
      background-position: 100% 0;
    }
    28%, 100% {
      background-position: 0% 0;
    }
  }
  /* ── Entrance ─────────────────────────────────────────────────────────
     The tiles of a row rise in one after another, by their place in it. Each starts after the boot
     script has released `.av-booting` (two frames), which would otherwise
     collapse the animation to nothing; the reduced-motion reset and
     `data-av-motion` collapse it on purpose. */
  .av-stat-card {
    animation: stat-card-enter var(--av-duration-slower) var(--av-ease-emphasized) var(--av-duration-fastest) backwards;
  }
  .av-stat-card:nth-child(2) {
    animation-delay: calc(var(--av-duration-fastest) * 2);
  }
  .av-stat-card:nth-child(3) {
    animation-delay: calc(var(--av-duration-fastest) * 3);
  }
  .av-stat-card:nth-child(n+4) {
    animation-delay: calc(var(--av-duration-fastest) * 4);
  }
  @keyframes stat-card-enter {
    from {
      opacity: 0;
      translate: 0 var(--av-space-3);
    }
  }
  /* Under reduced motion the global reset shortens an animation but keeps its
     delay, which would leave the later tiles invisible for that long. They
     are simply there instead, and the sheen does not cross. */
  @media (prefers-reduced-motion: reduce) {
    .av-stat-card,
    .av-stat-card--hero::after {
      animation: none;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-stat-card,
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-stat-card--hero::after {
    animation: none;
  }
  .av-stat-card:hover {
    translate: 0 var(--av-lift);
    box-shadow: var(--av-shadow-lg);
    border-color: color-mix(in oklab, var(--av-color-primary) 22%, var(--av-border-subtle));
  }
  [data-bs-theme=dark] .av-stat-card:hover {
    box-shadow: var(--av-shadow-lg), 0 0 28px color-mix(in oklab, var(--av-color-primary) 12%, transparent);
  }
  .av-stat-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
  }
  .av-stat-card__label {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
  }
  /* The flat tile's chip follows the series too, deepened so the glyph clears
     3:1 on its own tint whichever hue the wheel handed it; a role chip below
     keeps its role tokens. */
  .av-stat-card__icon {
    display: grid;
    place-items: center;
    inline-size: 40px;
    block-size: 40px;
    border-radius: var(--av-radius-md);
    background: color-mix(in oklab, var(--av-stat-series, var(--av-color-primary)) var(--av-kpi-chip), transparent);
    color: oklch(from var(--av-stat-series, var(--av-color-primary)) min(l, 0.45) c h);
  }
  /* On a dark card the deepened glyph would be dark on dark; lift it instead. */
  [data-bs-theme=dark] .av-stat-card__icon {
    color: oklch(from var(--av-stat-series, var(--av-color-primary)) max(l, 0.8) c h);
  }
  .av-stat-card__icon--success {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-stat-card__icon--warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
  }
  .av-stat-card__icon--info {
    background: var(--av-color-info-subtle);
    color: var(--av-color-info-text);
  }
  .av-stat-card__icon--danger {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  /* The glow lifts the icon tile off the card without adding a border. It is
     applied on hover only — twenty permanently glowing tiles on a dashboard
     read as noise rather than depth. */
  .av-stat-card__icon {
    transition: box-shadow var(--av-duration-normal) var(--av-ease-standard), scale var(--av-duration-normal) var(--av-ease-spring);
  }
  .av-stat-card:hover .av-stat-card__icon {
    scale: 1.06;
    box-shadow: var(--av-glow-primary);
  }
  .av-stat-card:hover .av-stat-card__icon--success {
    box-shadow: var(--av-glow-success);
  }
  .av-stat-card:hover .av-stat-card__icon--warning {
    box-shadow: var(--av-glow-warning);
  }
  .av-stat-card:hover .av-stat-card__icon--info {
    box-shadow: var(--av-glow-info);
  }
  .av-stat-card__value {
    font-size: var(--av-font-size-3xl);
    font-weight: 650;
    line-height: var(--av-line-height-tight);
    letter-spacing: var(--av-tracking-tight);
    font-variant-numeric: tabular-nums;
  }
  /* Half a phone's width: the tile tightens so a compact figure still fits. */
  @media (max-width: 575.98px) {
    .av-stat-card {
      padding: var(--av-space-4);
    }
    .av-stat-card__value {
      font-size: var(--av-font-size-2xl);
    }
    /* Two tiles a row here: a display-size figure no longer fits its tile. */
    .av-stat-card--hero .av-stat-card__value {
      font-size: var(--av-font-size-2xl);
    }
    .av-stat-card__icon {
      inline-size: 32px;
      block-size: 32px;
    }
    .av-stat-card__foot {
      flex-wrap: wrap;
      row-gap: 0;
    }
  }
  /* The tile's own trend, drawn under the figure: a `data-av-chart` in
     sparkline mode. The height is reserved so the tile does not grow when the
     chart arrives. */
  .av-stat-card__spark {
    min-block-size: 44px;
    margin-block-start: auto;
  }
  /* The chart resolves its colours in script, before it can know the tile is
     filled, and a green or red line on a filled tile neither reads nor means
     anything. So on a vivid tile the drawing is flattened to the tile's white
     ink; a style whose filled tile carries dark ink flattens it to black. */
  .av-stat-card--vivid .av-stat-card__spark {
    filter: brightness(0) invert(1);
  }
  .av-stat-card__foot {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-0-5);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  /* Direction is not sentiment. A falling refund rate, churn figure or page
     load time is good news, and colouring it red because the arrow points down
     tells the reader the opposite of the truth. --up/--down describe the
     movement; --good/--bad describe what it means, and a metric where the two
     disagree uses the latter.

     Which is why the two pairs are separate rules in this order rather than two
     grouped selectors. All four are 0-1-0, so the winner between them is decided
     by source position — and with `--up, --good` grouped ahead of
     `--down, --bad`, an element carrying `--down --good` matched the *later*
     rule and painted churn-is-falling in red: the exact reading the paragraph
     above says to avoid. No page had used a mixed pair yet, so the rule the
     comment described had simply never been true. The semantic pair goes last,
     so it always outranks the directional one. */
  .av-trend--up {
    color: var(--av-color-success-text);
  }
  .av-trend--down {
    color: var(--av-color-danger-text);
  }
  .av-trend--good {
    color: var(--av-color-success-text);
  }
  .av-trend--bad {
    color: var(--av-color-danger-text);
  }
  .av-trend .av-icon {
    inline-size: 14px;
    block-size: 14px;
  }
  /* The denominator beside a figure — "7 of 10", "3 of 5 seats". It steps
     down to body size and muted ink so the figure stays the thing being read,
     and it lives inside `__value` rather than beside it so the two wrap
     together. */
  .av-stat-card__unit {
    font-size: var(--av-font-size-base);
    color: var(--av-text-muted);
  }
}
@layer components {
  /* Role card ────────────────────────────────────────────────────────────
     One card per role, above the permission matrix it summarises.

     It replaces four `.av-stat-card`s that were the exact trap `_stat-card.scss`
     documents: under `[data-av-depth="rich"]` a card with no role modifier falls
     back to the brand hue, so the page opened with four saturated blue slabs
     carrying the numbers 1, 1, 3 and 2 — identical in colour, identical in
     shape, and one of them ("Billing & Viewer") only existed because there were
     four slots and five roles.

     What a roles page is actually asked is *how much can this role do*, and a
     count of members does not answer it. So the card carries the reach as well:
     a meter of granted capabilities against the total, which is the same figure
     the matrix below spells out one row at a time. Five cards, one per role, so
     nothing has to be merged to fit the grid.

     `--av-role-accent` is the whole differentiation. Each modifier sets it once
     and the mark, the meter and the hover border all read it, so a new role is a
     modifier rather than four more rules. */
  .av-role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--av-space-3);
  }
  .av-role-grid > * {
    min-inline-size: 0;
  }
  .av-role-card {
    --av-role-accent: var(--av-color-primary);
    --av-role-tint: var(--av-color-primary-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--av-space-3);
    padding: var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard), translate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-role-card:hover {
    border-color: var(--av-role-accent);
    box-shadow: var(--av-shadow-sm);
    translate: 0 var(--av-lift-sm);
  }
  .av-role-card__head {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
  }
  .av-role-card__mark {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 32px;
    block-size: 32px;
    border-radius: var(--av-radius-md);
    background: var(--av-role-tint);
    color: var(--av-role-accent);
  }
  .av-role-card__mark .av-icon {
    inline-size: 17px;
    block-size: 17px;
  }
  .av-role-card__name {
    flex: 1;
    min-inline-size: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  /* The member count. Tabular figures because five of these sit in a row and a
     proportional `1` beside a proportional `3` makes the row look misaligned.

     The unit is visible rather than `.av-visually-hidden`, which is where it
     started: a bare `1` next to a role name is a number with no noun, and a
     sighted reader has exactly the problem the hidden text was written to solve
     for everybody else. */
  .av-role-card__count {
    display: flex;
    align-items: baseline;
    gap: var(--av-space-1);
    flex: none;
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-role-card__count-unit {
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-muted);
  }
  .av-role-card__text {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-role-card__meter {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1-5);
    margin-block-start: auto;
  }
  .av-role-card__meter-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums lining-nums;
  }
  /* The meter is `.av-progress` contextualised, not a second progress bar. The
     only thing this component changes is the fill, which has to be the role
     accent rather than the brand gradient — five cards in a row all filled with
     one gradient is the same undifferentiated wall the stat cards were. */
  .av-role-card .av-progress {
    block-size: 4px;
  }
  .av-role-card .av-progress__bar {
    background: var(--av-role-accent);
  }
  .av-role-card--success {
    --av-role-accent: var(--av-color-success);
    --av-role-tint: var(--av-color-success-subtle);
  }
  .av-role-card--warning {
    --av-role-accent: var(--av-color-warning);
    --av-role-tint: var(--av-color-warning-subtle);
  }
  .av-role-card--danger {
    --av-role-accent: var(--av-color-danger);
    --av-role-tint: var(--av-color-danger-subtle);
  }
  .av-role-card--info {
    --av-role-accent: var(--av-color-info);
    --av-role-tint: var(--av-color-info-subtle);
  }
  .av-role-card--neutral {
    --av-role-accent: var(--av-text-secondary);
    --av-role-tint: var(--av-color-neutral-subtle);
  }
}
@layer components {
  .av-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1);
    min-block-size: 20px;
    padding: 2px var(--av-space-2);
    border-radius: var(--av-radius-full);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
  }
  /* Sized here rather than inline, so a badge built by the runtime matches one
     written by hand. */
  .av-badge .av-icon {
    inline-size: 12px;
    block-size: 12px;
  }
  .av-badge--primary-soft {
    background: var(--av-color-primary-subtle);
    border: 1px solid var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  .av-badge--success-soft {
    background: var(--av-color-success-subtle);
    border: 1px solid var(--av-color-success-border);
    color: var(--av-color-success-text);
  }
  .av-badge--warning-soft {
    background: var(--av-color-warning-subtle);
    border: 1px solid var(--av-color-warning-border);
    color: var(--av-color-warning-text);
  }
  .av-badge--danger-soft {
    background: var(--av-color-danger-subtle);
    border: 1px solid var(--av-color-danger-border);
    color: var(--av-color-danger-text);
  }
  .av-badge--info-soft {
    background: var(--av-color-info-subtle);
    border: 1px solid var(--av-color-info-border);
    color: var(--av-color-info-text);
  }
  .av-badge--neutral-soft {
    background: var(--av-color-neutral-subtle);
    border: 1px solid var(--av-color-neutral-border);
    color: var(--av-color-neutral-text);
  }
  /* Solid roles ─────────────────────────────────────────────────────────
     A soft badge is a label; a solid one is a claim, and a catalogue needs
     both. When every pill on a card carries the same weight the reader's eye
     has nothing to sort by — a 25% discount and a category tag arrive as
     equals, which is the one thing the discount is not.

     `--av-text-on-<role>` is what makes a solid variant safe to offer at all:
     amber takes near-black ink and red takes white, that answer changes
     between light and dark, and the generator has already computed it. A
     component picking its own ink here would be picking it for one mode.

     Neutral is deliberately absent. There is no `--av-text-on-neutral`,
     because a solid neutral badge is a grey slab that says nothing louder
     than the soft one — the roles that ship solid are the five that have
     something to shout. */
  .av-badge--primary {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  .av-badge--success {
    background: var(--av-color-success);
    color: var(--av-text-on-success);
  }
  .av-badge--warning {
    background: var(--av-color-warning);
    color: var(--av-text-on-warning);
  }
  .av-badge--danger {
    background: var(--av-color-danger);
    color: var(--av-text-on-danger);
  }
  .av-badge--info {
    background: var(--av-color-info);
    color: var(--av-text-on-info);
  }
  /* A wrapping row of badges — achievements, labels, anything decorative that
     comes in a set. The three declarations are the same as `.av-actions`, and
     it is deliberately not that class: `.av-actions` means "the controls that
     act on the thing above this", and a grep for it should not return a row of
     ornaments. The duplication is three lines; the ambiguity would be
     permanent. */
  .av-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
}
@layer components {
  /* Table ───────────────────────────────────────────────────────────── */
  /* position: an absolute child (a visually-hidden header label) is clipped by the scroller instead of widening the page. */
  .av-table-wrap {
    position: relative;
    overflow-x: auto;
  }
  .av-table {
    inline-size: 100%;
    border-collapse: collapse;
    font-size: var(--av-font-size-sm);
  }
  /* Scope to thead: a <th scope="row"> is a row header, not a column header,
     and must not inherit the sticky bar's background or uppercase treatment. */
  .av-table thead th {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-sticky);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wide);
    text-transform: uppercase;
    text-align: start;
    padding: var(--av-space-3) var(--av-space-4);
  }
  .av-table tbody th,
  .av-table td {
    padding: var(--av-space-3) var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
    font-variant-numeric: tabular-nums lining-nums;
    text-align: start;
    vertical-align: middle;
  }
  .av-table tbody th {
    font-weight: var(--av-font-weight-medium);
    white-space: nowrap;
  }
  .av-table tbody tr {
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard);
  }
  /* A faint brand wash rather than a grey fill: on a long table the grey reads
     as a disabled row, the tint reads as the pointer. background-color stays
     underneath so the row is still opaque over the page mesh. */
  .av-table tbody tr:hover {
    background-color: var(--av-surface-sunken);
    background-image: var(--av-gradient-brand-soft);
  }
  .av-table .av-table__num {
    text-align: end;
  }
  /* An avatar, a name and a secondary line: the most repeated composition in
     the product, on seventeen page sources.

     All three of these were named `__customer` for the first table that used
     one, and the family has now been renamed twice for the same reason.
     `.av-table__customer-name` became `.av-table__link` when the demo index
     needed a row link; `__customer` and `__customer-mail` were left behind and
     became `__person` and `__person-meta` here. It is the defect already
     recorded against `.av-section` living in `_example.scss` and `.av-avatar`
     in the topbar partial: a primitive named after the first screen that wanted
     it, so the next screen either copies the rules or wears a class describing
     somebody else's data. These rows carry users, employees, post authors,
     project leads and ticket reporters, none of whom is a customer.

     `-meta` rather than `-mail` for the second line, because it already holds
     an email on some pages, a city on others and "12 orders · €2,840 lifetime"
     on one — the old name was the same mistake one level down. */
  .av-table__person {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
  }
  /* A row's own link — the person's name, the sender, the page title. */
  .av-table__link {
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  /* It is the *only* thing in the cell that is a link, and it is not underlined
     at rest. Underlining puts a rule under every row of the table and turns the
     column into a wall of blue-ish chrome competing with the data; the
     affordance a reader needs here is the pointer, and the underline arrives
     with it. Colour is deliberately not the signal — an underline on hover and
     a focus ring on tab both survive a colour-blind reader, and the cell is
     already carrying a badge and two shades of grey. */
  a.av-table__link {
    text-decoration: none;
  }
  a.av-table__link:hover {
    text-decoration: underline;
  }
  .av-table__person-meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* Variants ────────────────────────────────────────────────────────── */
  /* Striping goes on `background-image`, not `background-color`. The hover
     rule already owns background-color, and a stripe set there would win on
     odd rows and lose on even ones — the pointer highlight would flicker on
     and off down the table. Layering the stripe as an image lets hover paint
     underneath it. */
  .av-table--striped tbody tr:nth-child(odd of :not([hidden])) {
    background-image: linear-gradient(var(--av-surface-sunken), var(--av-surface-sunken));
  }
  .av-table--bordered th,
  .av-table--bordered td {
    border: 1px solid var(--av-border-subtle);
  }
  /* `--hover` is opt-in on a table that is otherwise static. The base table
     already highlights, so this only exists to be turned *off* by its absence
     on `--plain`. Kept as a modifier because the index names it. */
  .av-table--hover tbody tr {
    cursor: pointer;
  }
  /* The base table already sticks its thead — this modifier exists to give the
     bar a solid ground and a rule beneath it, which only matters once the rows
     scroll under it. Without the shadow the header and the first row merge. */
  .av-table--sticky-head thead th {
    background: var(--av-surface-raised);
    box-shadow: inset 0 -1px 0 0 var(--av-border-default);
  }
  /* A sticky first column has to out-stack the sticky header at the corner
     cell, or the two overlap and whichever paints later wins. The header cell
     is raised one step so the corner belongs to the header, which is the
     reading most people expect. */
  .av-table--sticky-col :is(th, td):first-child {
    position: sticky;
    inset-inline-start: 0;
    z-index: var(--av-z-sticky);
    background: var(--av-surface-raised);
  }
  .av-table--sticky-col thead th:first-child {
    z-index: var(--av-z-topbar);
  }
  /* Card table: below the breakpoint the table stops being a grid and each row
     becomes a stacked card, with the column name supplied by `data-av-label`.
     `display: block` on table elements is what makes this possible, and the
     reason the labels live in an attribute rather than a duplicated column —
     a hidden label column is read out by a screen reader on every row.

     `role="…"` is deliberately NOT overridden: changing display on a table
     already drops its implicit table semantics in most engines, and the label
     text restores what the header was providing. */
  @media (width < 48rem) {
    .av-table--cards thead {
      display: none;
    }
    .av-table--cards :is(tbody, tr, th, td) {
      display: block;
    }
    .av-table--cards tbody tr {
      margin-block-end: var(--av-space-3);
      border: 1px solid var(--av-border-subtle);
      border-radius: var(--av-radius-md);
      background: var(--av-surface-raised);
    }
    .av-table--cards :is(tbody th, td) {
      display: flex;
      justify-content: space-between;
      gap: var(--av-space-4);
      border-block-start: 0;
      text-align: end;
    }
    .av-table--cards :is(tbody th, td)::before {
      content: attr(data-av-label);
      color: var(--av-text-muted);
      font-weight: var(--av-font-weight-medium);
      text-align: start;
    }
    /* A cell with no label would collapse its flex row and push the value to
       the start edge, which breaks the column of values down the card. */
    .av-table--cards :is(tbody th, td):not([data-av-label])::before {
      content: "";
    }
  }
  /* A second line inside a cell — a creation date under a name, a SKU under a
     product. It is not a separate column: a column would be sortable, and
     nobody sorts by "created 4 February" when the name is what they scanned
     for. */
  .av-table__sub {
    display: block;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
  /* The trailing cell of controls. `white-space: nowrap` because a row of two
     buttons that wraps to two lines doubles the height of one row and makes
     the table look broken rather than full. */
  .av-table__actions {
    text-align: end;
    white-space: nowrap;
  }
  .av-table__actions > * {
    vertical-align: middle;
  }
}
@layer components {
  /* Expandable rows ─────────────────────────────────────────────────── */
  /* The detail row is a real <tr> in the table, hidden with `hidden`, not a
     panel positioned underneath. That keeps it inside the table's own column
     model, so its content lines up with the columns above it, and it stays in
     reading order for a screen reader working down the rows.

     It carries a single <td colspan> because a detail row that reproduces the
     column structure would be announced as a data row with empty cells. */
  .av-table__detail > td {
    padding: var(--av-space-4);
    background: var(--av-surface-sunken);
  }
  .av-table__expand {
    display: grid;
    place-items: center;
    inline-size: var(--av-space-6);
    block-size: var(--av-space-6);
    padding: 0;
    border: 0;
    border-radius: var(--av-radius-sm);
    background: none;
    color: var(--av-text-muted);
    cursor: pointer;
  }
  /* The chevron rotates rather than swapping glyphs, so there is one icon in
     the markup and no chance of the two states carrying different sizes. The
     rotation is on the block axis, so it needs no RTL flip. */
  .av-table__expand svg {
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
    transition: rotate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-table__expand[aria-expanded=true] svg {
    rotate: 90deg;
  }
  /* Inline edit ─────────────────────────────────────────────────────── */
  /* The cell holds a real <input> that is styled to look like text until it is
     focused. A contenteditable span would look identical and lose the
     platform's undo stack, autofill, form association and mobile keyboard
     hints — all of which come free with an input. */
  .av-inline-edit {
    inline-size: 100%;
    padding: var(--av-space-1) var(--av-space-2);
    border: 1px solid transparent;
    border-radius: var(--av-radius-sm);
    background: none;
    color: inherit;
    font: inherit;
    /* Same box in both states, so committing an edit does not reflow the row.
       Without it the row jumps by the border width on every focus. */
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-inline-edit:hover {
    border-color: var(--av-border-subtle);
  }
  .av-inline-edit:focus {
    border-color: var(--av-color-primary);
    background: var(--av-surface-base);
    outline: none;
  }
  /* `outline: none` above is only allowed because the border replaces it — the
     linter enforces exactly that, and a focused field with neither is the
     single most common accessibility regression in a table. */
  .av-inline-edit[data-av-state=saved] {
    border-color: var(--av-color-success-border);
    background: var(--av-color-success-subtle);
  }
  /* Column chooser ──────────────────────────────────────────────────── */
  /* A column is hidden by an attribute on the table rather than by adding a
     class to every cell: one write instead of one per row, and a table with a
     thousand rows does not spend a frame in `classList`. */
  .av-table[data-av-hidden-cols] :is(th, td)[data-av-col].is-col-hidden {
    display: none;
  }
  .av-columns__item {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-1-5) var(--av-space-2);
    font-size: var(--av-font-size-sm);
    cursor: pointer;
  }
  /* Tree table ──────────────────────────────────────────────────────── */
  /* Depth is a custom property on the row, read as padding by the first cell.
     Nesting real <table> elements would break column alignment between levels,
     and indenting with nested <div>s would leave the table without a column
     model at all. */
  .av-table--tree tbody tr > :is(th, td):first-child {
    padding-inline-start: calc(var(--av-space-4) + var(--av-tree-depth, 0) * var(--av-space-5));
  }
  /* `.av-table__expand` is reused for the twisty, so a tree row and an
     expandable row cannot end up with different affordances. */
  .av-table--tree .av-table__expand {
    margin-inline-end: var(--av-space-1);
  }
  /* A leaf keeps the button's footprint so its label starts on the same
     vertical line as a parent's. Removing the element instead makes every leaf
     sit one control's width to the start of its siblings. */
  .av-table__leaf {
    display: inline-block;
    inline-size: var(--av-space-6);
  }
  /* Sortable list ───────────────────────────────────────────────────── */
  .av-sortable {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-2);
    padding: 0;
    margin: 0;
    list-style: none;
  }
  .av-sortable__item {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-raised);
  }
  .av-sortable__handle {
    color: var(--av-text-muted);
    cursor: grab;
  }
  /* Sortable's own state classes, named by the JS config rather than by the
     library's defaults so the stylesheet does not depend on a vendor's naming.
     The ghost is where the item will land; the drag is what follows the
     pointer. */
  .av-sortable__item.is-ghost {
    opacity: 0.4;
    background: var(--av-color-primary-subtle);
  }
  .av-sortable__item.is-dragging {
    box-shadow: var(--av-shadow-lg);
  }
  /* Repeater ────────────────────────────────────────────────────────── */
  .av-repeater {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-3);
  }
  .av-repeater__row {
    display: flex;
    align-items: flex-end;
    gap: var(--av-space-3);
  }
  .av-repeater__row > * {
    flex: 1;
    min-inline-size: 0;
  }
  .av-repeater__remove {
    flex: none;
  }
  /* A line-item row: description, then three narrow columns that must not share
     the flex growth the default row gives every child. Named for the *shape*
     rather than the screen that needed it first — an invoice, a quote, a credit
     note and a purchase order all want this row, and naming it `--invoice`
     would have been the mistake `.av-section` and `.av-promo` were extracted to
     undo. */
  .av-repeater__row--line-item {
    align-items: flex-end;
  }
  .av-repeater__row--line-item > .av-field:first-child {
    flex: 3;
  }
  /* The computed amount is not a control, so it is not a field — but it has to
     sit on the same baseline as the inputs beside it, which is why it carries
     its own label rather than borrowing one. */
  .av-repeater__amount {
    flex: 1;
    min-inline-size: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1-5);
    text-align: end;
    font-variant-numeric: tabular-nums;
    font-weight: var(--av-font-weight-semibold);
  }
}
@layer components {
  /* Data grid: toolbar, sorting, selection, pagination ──────────────── */
  .av-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-4) var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-toolbar__search {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    min-inline-size: 220px;
    flex: 1 1 220px;
    max-inline-size: 320px;
    padding-inline: var(--av-space-3);
    min-block-size: 38px;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-toolbar__search:focus-within {
    border-color: var(--av-color-primary);
  }
  .av-toolbar__search input {
    flex: 1;
    min-inline-size: 0;
    border: 0;
    background: none;
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
  }
  .av-toolbar__search input:focus {
    outline: none;
  }
  .av-toolbar__spacer {
    margin-inline-start: auto;
  }
  /* The mirror of `__spacer`: an item that stays at the *start* of the bar and
     pushes everything after it to the end. The inventory bar's staged-edit
     count wore `__spacer` and then wrote `margin-inline-end: auto` inline to
     fight it, so the element had an auto margin on both sides and floated in
     the middle of the bar, anchored to neither edge — measured at x=591 in a
     958px bar where every other toolbar count in the product sits at the start
     edge. The bar is `hidden` until an edit is staged, so no baseline tile has
     ever contained it and no gate could have seen it. */
  .av-toolbar__lead {
    margin-inline-end: auto;
  }
  /* The search in a split view, where the pane is narrower than the 220px
     flex basis the standalone toolbar wants. Mail, chat and contacts had all
     three written `flex: 1` inline — the same modifier three times, in the
     one place a fourth split view could not find it. */
  .av-toolbar__search--fluid {
    flex: 1;
  }
  .av-toolbar__count {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  /* Bulk-action bar replaces the toolbar contents when rows are selected */
  .av-bulkbar {
    display: none;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-5);
    border-block-end: 1px solid var(--av-color-primary-border);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-size: var(--av-font-size-sm);
  }
  .av-bulkbar.is-active {
    display: flex;
  }
  .av-bulkbar__count {
    font-weight: var(--av-font-weight-semibold);
  }
  /* The select column sizes the painted control through the inherited custom
     property rather than restating its box — see `components/_check.scss`. */
  .av-table__check {
    inline-size: 44px;
    --av-check-size: 16px;
  }
  .av-table tbody tr.is-selected {
    background: var(--av-surface-accent-subtle);
  }
  .av-table__sort {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
  }
  .av-table__sort:hover {
    color: var(--av-text-primary);
  }
  /* The button is as tall as the header label, 18px. The cell around it is
     taller, but the cell is not the control. */
  @media (pointer: coarse) {
    .av-table__sort {
      min-block-size: var(--av-size-touch-min);
      /* Both axes: a short column label such as "Qty" left a 23px-wide button
         even once the height was right. */
      min-inline-size: var(--av-size-touch-min);
    }
  }
  /* The header row dictates this glyph's size — 14px is what fits beside a
     column label, and snapping it to the 16px scale step widened every
     sortable `<th>` and re-laid-out the whole table. A size the component
     owns belongs on the component, not in the author's call. */
  .av-table__sort-icon {
    --av-icon-size: 14px;
    opacity: 0.35;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard);
  }
  [aria-sort=ascending] .av-table__sort-icon,
  [aria-sort=descending] .av-table__sort-icon {
    opacity: 1;
  }
  [aria-sort=descending] .av-table__sort-icon {
    rotate: 180deg;
  }
  [aria-sort] .av-table__sort {
    color: var(--av-text-primary);
  }
  .av-table__actions-cell {
    inline-size: 56px;
    text-align: end;
  }
  .av-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    min-block-size: 32px;
    padding-inline: var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-filter-chip:hover {
    border-color: var(--av-border-strong);
  }
  .av-filter-chip[aria-pressed=true] {
    background: var(--av-color-primary-subtle);
    border-color: var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  /* The count belongs on the chip rather than in a stat card above the table.
     A number a reader cannot press is a report; the same number inside the
     control that applies it is navigation — and it can never disagree with the
     list underneath, because pressing it is what produced the list. */
  .av-filter-chip__count {
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  /* Full strength: faded to 75% it fell under 4.5:1 on the ocean preset in light mode. */
  .av-filter-chip[aria-pressed=true] .av-filter-chip__count {
    color: inherit;
  }
}
@layer components {
  .av-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-pagination__info {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .av-pagination__pages {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
  }
  .av-pagination__page {
    display: grid;
    place-items: center;
    min-inline-size: 32px;
    block-size: 32px;
    padding-inline: var(--av-space-2);
    border: 1px solid transparent;
    border-radius: var(--av-radius-sm);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    font-variant-numeric: tabular-nums;
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard);
  }
  .av-pagination__page:hover:not([aria-disabled=true]) {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-pagination__page[aria-current=page] {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  /* `aria-disabled`, never `:disabled`, and the difference is the whole reason
     this rule reads the way it does. A `<button disabled>` leaves the tab order
     and is blurred by the browser the instant the attribute lands — so pressing
     `Next` onto the final page destroys the focus of the very control that took
     you there, and the reader's next Tab starts again from "Skip to main
     content". The runtime marks the attribute instead, `initActions` enforces it
     with a capture-phase listener on `document` so the click genuinely cannot
     act, and the button stays where the keyboard left it.

     `pointer-events: none` is deliberately absent for the same reason: it would
     stop the click before the guard could see it, and with it the announcement
     the guard makes to assistive technology. The control refuses, visibly, in
     place. */
  .av-pagination__page[aria-disabled=true] {
    opacity: 0.4;
    cursor: default;
  }
  .av-pagination__ellipsis {
    color: var(--av-text-muted);
    padding-inline: var(--av-space-1);
  }
  /* The "Page 2 of 27" readout the two reduced variants carry instead of a
     numbered list. It is a live region in the markup, not here — the runtime
     rewrites its text, and a reader who cannot see the bar move needs to be
     told the page changed. */
  .av-pagination__status {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    font-variant-numeric: tabular-nums;
    padding-inline: var(--av-space-2);
    text-align: center;
  }
  /* ── Simple ───────────────────────────────────────────────────────────
     Previous and Next pushed to the edges with the readout between them. The
     bar spans its container rather than hugging the end, because with no number
     list there is nothing on the left to balance against. */
  .av-pagination--simple .av-pagination__pages {
    flex: 1;
    justify-content: space-between;
    gap: var(--av-space-3);
  }
  /* Bordered here and nowhere else. In the numbered bar the buttons sit
     shoulder to shoulder, so proximity alone says "these are controls"; pushed
     to opposite edges of a wide container with no chrome, the same button reads
     as a caption. It is the one place in this component where a transparent
     border is not enough, and it was found by looking at the rendered page
     rather than by measuring it. */
  .av-pagination--simple .av-pagination__page:not([aria-disabled=true]) {
    border-color: var(--av-border-default);
  }
  /* ── Compact ──────────────────────────────────────────────────────────
     For a toolbar or a card header: centred, no count, no border of its own —
     it is a control inside something else rather than the foot of a table. */
  .av-pagination--compact {
    justify-content: center;
    padding: var(--av-space-2) var(--av-space-3);
    border-block-start: none;
  }
  .av-pagination--compact .av-pagination__pages {
    gap: var(--av-space-2);
  }
  .av-pagination--compact .av-pagination__status {
    min-inline-size: 64px;
    padding-inline: 0;
  }
}
@layer components {
  /* Filter builder, saved views and export ──────────────────────────────
     The panel a datagrid opens to answer a question a search box cannot.
     It lives in a drawer, so the table stays on screen while the filters are
     being built — a modal here would hide the only thing that tells you
     whether the filter you just wrote is the one you meant. */
  .av-filter-panel {
    display: grid;
    gap: var(--av-space-5);
    align-content: start;
  }
  .av-filter-group {
    display: grid;
    gap: var(--av-space-2);
  }
  .av-filter-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-2);
  }
  .av-filter-group__title {
    margin: 0;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
  }
  .av-filter-list {
    display: grid;
    gap: var(--av-space-2);
  }
  /* A filter is one row: field, condition, value, remove. The controls are
     sized by `--av-control-height` rather than a `--sm` modifier on each one,
     because that is the property `.av-input`, `.av-select` and `.av-textarea`
     already read — the same arrangement `--av-check-size` uses to size
     seventy-five checkboxes from one declaration on the table. */
  .av-filter-row {
    --av-control-height: var(--av-control-sm);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
    grid-template-areas: "field op value remove";
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-2);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
  }
  .av-filter-row > :nth-child(1) {
    grid-area: field;
  }
  .av-filter-row > :nth-child(2) {
    grid-area: op;
  }
  .av-filter-row__value {
    grid-area: value;
  }
  .av-filter-row > :last-child {
    grid-area: remove;
  }
  /* A range needs its own line. Squeezed into the shared value track inside a
     480px drawer, each half of a `between` is about 40px wide — enough to show
     "50" of "500" and "20" of "2000", which is a control reporting a number
     that is not the number it holds. */
  .av-filter-row:has(.av-filter-row__and) {
    grid-template-areas: "field op op remove" "value value value value";
  }
  @media (max-width: 560px) {
    .av-filter-row,
    .av-filter-row:has(.av-filter-row__and) {
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas: "field remove" "op op" "value value";
    }
  }
  /* The value slot holds one control, or two with the word "and" between them
     for a range. It is a grid rather than a flex row so the two halves of a
     range are the same width — a `between` whose second field is narrower
     reads as a different kind of field. */
  .av-filter-row__value {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: var(--av-space-1-5);
    min-inline-size: 0;
  }
  .av-filter-row__value:has(.av-filter-row__and) {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .av-filter-row__and {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-filter-empty {
    margin: 0;
    padding: var(--av-space-3);
    border: 1px dashed var(--av-border-default);
    border-radius: var(--av-radius-md);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    text-align: center;
  }
  /* Saved views ────────────────────────────────────────────────────────
     A chip with two targets: the name opens the view, the cross deletes it.
     They are two `<button>`s rather than one button with a nested control,
     because a button inside a button is invalid and the browser resolves it
     by making the inner one unreachable — the same failure the product card's
     stretched title link produced over the wishlist heart. */
  .av-view-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
  .av-view-chip {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    overflow: hidden;
  }
  .av-view-chip:hover {
    border-color: var(--av-color-primary);
  }
  .av-view-chip__open,
  .av-view-chip__remove {
    border: 0;
    background: none;
    color: var(--av-text-secondary);
    font: inherit;
    font-size: var(--av-font-size-xs);
    cursor: pointer;
  }
  .av-view-chip__open {
    padding: var(--av-space-1-5) var(--av-space-1) var(--av-space-1-5) var(--av-space-3);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-view-chip__remove {
    display: grid;
    place-items: center;
    padding-inline: var(--av-space-2);
  }
  .av-view-chip__open:hover {
    color: var(--av-color-primary-text);
  }
  .av-view-chip__remove:hover {
    color: var(--av-color-danger-text);
  }
  .av-view-chip__open:focus-visible,
  .av-view-chip__remove:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: calc(var(--av-focus-offset) * -1);
  }
  /* The count on the toolbar trigger. It is the only thing that tells a
     reader arriving on a shared link that the table in front of them is a
     filtered subset rather than everything there is — which, without it, is
     an empty-looking table that reads as missing data. */
  .av-filter-count {
    display: inline-grid;
    place-items: center;
    min-inline-size: 18px;
    padding-inline: var(--av-space-1);
    margin-inline-start: var(--av-space-1);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    line-height: 1.6;
  }
}
@layer components {
  /* CSV import ──────────────────────────────────────────────────────────
     Three steps in a dialog: choose, map, look at what will land. The wizard
     chrome is `.av-steps` and `[data-av-wizard]`, unchanged — only the two
     generated tables below belong to this component. */
  .av-import {
    display: grid;
    gap: var(--av-space-4);
    /* The rail above sets the reading rhythm for the whole dialog, and without
       this its labels sit directly on the first line of the panel below. */
    margin-block-start: var(--av-space-5);
    min-block-size: 22rem;
    align-content: start;
  }
  /* The dropzone is the same shape as the avatar cropper's, and deliberately
     not the same class: that one is `.av-avatar-drop` inside `_avatar-upload`,
     sized for a square photograph and carrying its own hover tint. Two
     components that look alike are not one component, and merging them would
     be the `.av-chip` collision this stylesheet already carries a baseline
     for. What they *do* share is the reasoning, and it is repeated rather than
     borrowed: the whole panel is a `<label>`, and the input is off-screen
     rather than `display: none`, because a hidden control is not focusable. */
  /* The drop zone sizes its own glyph, and it does so from a spacing token
     rather than a scale step — deliberately, because it scales with the
     zone's padding rather than with the icon scale. It sets the property. */
  .av-import-drop .av-icon {
    --av-icon-size: var(--av-space-8);
  }
  .av-import-drop {
    display: grid;
    place-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-8) var(--av-space-6);
    border: 1px dashed var(--av-border-strong);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-import-drop:hover,
  .av-import-drop.is-over {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
  }
  .av-import-drop:focus-within {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  .av-import-drop__title {
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-import-drop__hint {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-import-drop input[type=file] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  /* The map ────────────────────────────────────────────────────────────
     Field, the column feeding it, and the first value in that column. The
     sample is the third track for a reason: a mapping screen that shows only
     header names is a guess with extra steps, because "Total" and "Total inc.
     VAT" are the same word at a glance and different numbers in the file. */
  .av-map-list {
    display: grid;
    gap: var(--av-space-2);
  }
  .av-map-row {
    --av-control-height: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-raised);
  }
  @media (max-width: 620px) {
    .av-map-row {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  .av-map-row__field {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-map-row__required {
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-normal);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-color-danger-text);
  }
  .av-map-row__sample {
    font-size: var(--av-font-size-xs);
    font-family: var(--av-font-mono);
    color: var(--av-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* The preview ────────────────────────────────────────────────────────
     Rows that will be skipped are marked, not hidden. An importer that shows
     you only what worked is one you have to run twice to find out what did
     not. The tint is `color-mix` against the surface rather than the danger
     subtle token, which at 97% lightness against a 97% card is a state nobody
     can see — the same finding as the notification filter chip. */
  .av-import-preview {
    max-block-size: 20rem;
    overflow: auto;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
  }
  /* Tighter than a page table on purpose: this one is read in a 20rem box
     inside a dialog, and the default row padding puts three rows in it. */
  .av-import-preview .av-table :is(th, td) {
    padding: var(--av-space-2) var(--av-space-3);
    font-size: var(--av-font-size-xs);
  }
  .av-import-preview tr.is-invalid {
    background: color-mix(in oklab, var(--av-color-danger) 10%, var(--av-surface-raised));
  }
  .av-import-problem {
    font-size: var(--av-font-size-xs);
    color: var(--av-color-danger-text);
  }
  .av-import__file,
  .av-import__summary {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
  }
  .av-import__status {
    margin: 0;
    min-block-size: var(--av-space-5);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-import__status.is-error {
    color: var(--av-color-danger-text);
  }
}
@layer components {
  /* Keyboard shortcuts ─────────────────────────────────────────────────
     Moved out of `components/_mail.scss`, where it lived because mail was the
     one screen that had shortcuts. That is the same accident as `.av-section`
     in `_example.scss` and `.av-avatar` in the topbar partial: a component
     named after its first caller. Now that every page carries bindings, the
     help list belongs beside the module that generates it. */
  .av-shortcut-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--av-space-2) var(--av-space-4);
    margin: 0;
    font-size: var(--av-font-size-sm);
  }
  .av-shortcut-list dt {
    justify-self: start;
  }
  .av-shortcut-list dd {
    margin: 0;
    color: var(--av-text-secondary);
  }
  /* A group heading inside a `<dl>` has to be a `<dt>` — a heading element
     between the pairs is invalid and screen readers stop announcing the list.
     It spans both tracks by taking its own row, which is what the empty `<dd>`
     beside it is for: a definition list has no way to say "this term has no
     description" other than an empty one. */
  .av-shortcut-list .av-shortcuts__group {
    grid-column: 1/-1;
    margin-block-start: var(--av-space-3);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
  }
  .av-shortcut-list .av-shortcuts__group:first-child {
    margin-block-start: 0;
  }
  .av-shortcut-list .av-shortcuts__group-spacer {
    display: none;
  }
  /* Two `<kbd>`s in one `<dt>` is a chord: press g, then d. The gap is what
     says "then" without a word. */
  .av-shortcut-list dt .av-kbd + .av-kbd {
    margin-inline-start: var(--av-space-1);
  }
  /* The pending-chord indicator ────────────────────────────────────────
     A key that silently arms a sequence is indistinguishable from a dead key,
     which is the failure already recorded here against a gallery switcher, a
     button spinner and a wishlist heart. This is the smallest honest answer:
     it appears the moment a prefix is pressed and leaves when the chord
     resolves or times out.

     Fixed to the viewport rather than placed in the layout, because it belongs
     to the document and there is exactly one — the module creates it, so no
     page has to carry markup for it. */
  .av-chord-hint {
    position: fixed;
    inset-block-end: var(--av-space-6);
    inset-inline-start: 50%;
    translate: -50% 0;
    z-index: var(--av-z-toast);
    padding: var(--av-space-2) var(--av-space-4);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-inverse);
    color: var(--av-text-inverse);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-sm);
    letter-spacing: 0.08em;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-chord-hint.is-visible {
    opacity: 1;
  }
  /* `translate` has no logical form, so the centring offset is the same in
     both directions here — but the property is still listed for the linter's
     directional-transform rule, which cannot tell a centring translate from a
     directional one and is right to ask. */
  [dir=rtl] .av-chord-hint {
    translate: 50% 0;
  }
}
@layer components {
  .av-virtual {
    block-size: var(--av-table-height, 480px);
    overflow: auto;
    /* The header is already `position: sticky` from `_table.scss`, and it
       sticks to this container rather than the page because this is the
       nearest scroll port. Nothing extra is needed to keep it in view. */
    overscroll-behavior: contain;
  }
  /* Fixed layout, or the columns are measured from whichever twenty rows
     happen to be mounted and visibly re-shuffle their widths as you scroll. */
  .av-virtual table {
    table-layout: fixed;
  }
  /* Gated on the state the module sets, so a table whose script never ran is
     left exactly as authored rather than squashed into a geometry nothing is
     maintaining. `--av-virtual-row` is written by the module from its
     `rowHeight` option; the fallback is that option's documented default. */
  /* The `:not()` is not tidiness. A spacer is a `<tr>` in the same tbody, so
     without it the data-row geometry below also lands on the spacer cells and
     outranks the spacer's own rule — which then sits there looking like it is
     holding the geometry together while doing nothing at all. */
  .av-virtual[data-av-state=virtual] tbody tr:not(.av-virtual__spacer) td,
  .av-virtual[data-av-state=virtual] tbody tr:not(.av-virtual__spacer) th {
    /* `block-size` on a table cell is a minimum, so the padding has to go or
       it is added to the row height rather than absorbed into it. Cells are
       vertically centred by the table's own `vertical-align`. */
    block-size: var(--av-virtual-row, 48px);
    padding-block: 0;
    /* A fixed-height row cannot wrap. Saying so here is better than letting a
       long value silently make one row taller than the rest. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Spacers stand in for every row outside the window, so their height *is* the
     geometry — the module sets it inline, per render. Any padding or border a
     table rule would give them is added to that height, and the list is then
     wrong by that much from the first row down. */
  .av-virtual__spacer > td {
    padding: 0;
    border: 0;
  }
  /* Paged view is the alternative for anyone the virtual one excludes, so it
     is a plain table: no fixed height, no scroll port, every row of the page
     in the document where a screen reader can reach it. */
  .av-virtual[data-av-state=paged] {
    block-size: auto;
    overflow-x: auto;
  }
  .av-virtual__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-virtual__pager {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    margin-inline-start: auto;
  }
  .av-virtual__status {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
}
@layer components {
  /* Progress / channel list ─────────────────────────────────────────── */
  .av-channel {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1-5);
  }
  .av-channel + .av-channel {
    margin-block-start: var(--av-space-4);
  }
  .av-channel__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-3);
    font-size: var(--av-font-size-sm);
  }
  .av-channel__name {
    font-weight: var(--av-font-weight-medium);
  }
  .av-channel__value {
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .av-progress {
    block-size: 6px;
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    overflow: hidden;
  }
  .av-progress__bar {
    /* The fill is a per-instance *value*, so it arrives as a custom property in
       markup rather than an `inline-size` declaration — the same shape the ring
       beside it has always used. 47 bars across 17 pages carried the raw
       declaration; one component was following two conventions.
       The 0% fallback matches what a bar with no value rendered before, and the
       indeterminate rule below still wins on specificity. */
    inline-size: var(--av-progress-value, 0%);
    block-size: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--av-color-primary), var(--av-accent-500));
  }
  /* Progress ring ───────────────────────────────────────────────────── */
  .av-progress-ring {
    --av-ring-size: 56px;
    --av-ring-width: 5px;
    --av-ring-value: 0;
    position: relative;
    inline-size: var(--av-ring-size);
    block-size: var(--av-ring-size);
  }
  .av-progress-ring svg {
    transform: rotate(-90deg);
    inline-size: 100%;
    block-size: 100%;
  }
  .av-progress-ring circle {
    fill: none;
    stroke-width: var(--av-ring-width);
  }
  .av-progress-ring__track {
    stroke: var(--av-surface-sunken);
  }
  .av-progress-ring__fill {
    stroke: var(--av-color-primary);
    stroke-linecap: round;
    stroke-dasharray: 125.6; /* 2πr, r = 20 */
    stroke-dashoffset: calc(125.6 - 125.6 * var(--av-ring-value) / 100);
    transition: stroke-dashoffset var(--av-duration-slow) var(--av-ease-standard);
  }
  .av-progress-ring__label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  /* `translate` is physical and has no logical form, so an indeterminate bar
     written with bare percentages sweeps left-to-right in a right-to-left
     interface — travelling *backwards* through the reading direction, which is
     the one place a progress indicator must not be ambiguous.

     Same tactic as the sidebar's active-row sweep and the auth panel's
     diagonal: carry the direction as a custom property and let the [dir] rule
     flip that one value, rather than duplicating the keyframes. */
  .av-progress--indeterminate .av-progress__bar {
    inline-size: 40%;
    animation: av-indeterminate 1.4s var(--av-ease-standard) infinite;
  }
  [dir=rtl] .av-progress--indeterminate {
    --av-progress-flow: -1;
  }
  @keyframes av-indeterminate {
    0% {
      translate: calc(-100% * var(--av-progress-flow, 1)) 0;
    }
    100% {
      translate: calc(250% * var(--av-progress-flow, 1)) 0;
    }
  }
  /* The fill gradient is physical too. 90deg points at the inline end in LTR
     and at the inline start in RTL, so the brand ramp reverses with the bar. */
  [dir=rtl] .av-progress__bar {
    background: linear-gradient(270deg, var(--av-color-primary), var(--av-accent-500));
  }
}
@layer components {
  /* Activity list ───────────────────────────────────────────────────── */
  .av-activity {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-activity__item {
    display: flex;
    gap: var(--av-space-3);
    padding-block: var(--av-space-3);
  }
  .av-activity__item + .av-activity__item {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-activity__text {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-activity__text strong {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-medium);
  }
  .av-activity__time {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
}
@layer components {
  /* Audit log ────────────────────────────────────────────────────────────
     The full activity trail: who did what, when, and from where.

     It is deliberately not a modifier on `.av-activity`, for the reason
     `_feed.scss` gives about itself one file along. `.av-activity` is a
     *summary* — a dashboard card showing the last five things that happened,
     where an avatar and a sentence is the whole job. A log is a record you
     audit: you arrive at it asking "did anyone touch billing last week", and
     that question needs three things the summary has no room for — the event's
     *kind*, so you can filter to it; its *context*, so a sign-in tells you the
     city and the browser rather than only the fact; and *date grouping*, so a
     hundred rows are navigable. Making one component do both would put four
     empty columns on every dashboard card.

     The layout premise is the same one the permission matrix needed: the
     account activity page was eight sentences down the left of an 820px card
     with 60% of every row empty. The row is a three-track grid now — mark,
     body, aside — so the time and the category sit at the far edge where a
     reader scanning *when* or *what kind* can run a straight line down them,
     and the context line fills the width the sentence left behind. */
  .av-log {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  /* The date break. A log without one reads as a single undifferentiated run
     and gives the eye nothing to jump between. Sticky, because the whole point
     of the heading is to answer "what day am I looking at" while you are
     somewhere in the middle of the day's rows. */
  .av-log__date {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-raised);
    padding: var(--av-space-3) var(--av-space-5);
    background: var(--av-surface-sunken);
    border-block: 1px solid var(--av-border-subtle);
  }
  .av-log__date h3 {
    margin: 0;
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wider);
    color: var(--av-text-muted);
  }
  .av-log__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: var(--av-space-3);
    padding: var(--av-space-4) var(--av-space-5);
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-log__item + .av-log__item {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-log__item:hover {
    background: var(--av-surface-sunken);
  }
  /* The event's kind, as a shape and a colour rather than only as a word. A
     log is scanned, not read, and an icon column is what makes "find the
     billing events" a glance instead of a search. The badge in the aside says
     the same thing in words, because a colour is not a label. */
  .av-log__mark {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 34px;
    block-size: 34px;
    border-radius: var(--av-radius-md);
    background: var(--av-log-tint, var(--av-color-neutral-subtle));
    color: var(--av-log-accent, var(--av-text-secondary));
  }
  .av-log__mark .av-icon {
    inline-size: 17px;
    block-size: 17px;
  }
  .av-log__body {
    min-inline-size: 0;
  }
  /* The event, in one line. `.av-log__text` is the explanation beneath it;
     with no title rule the two rendered at identical weight and the row read
     as a paragraph with no subject. */
  .av-log__title {
    margin: 0 0 var(--av-space-1);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-log__text {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-log__text strong {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-medium);
  }
  /* Where the event came from: city, browser, address, target. Separated by a
     middot rather than by more rows, because every extra row in a log is a
     row of height multiplied by however many entries there are. */
  .av-log__meta {
    margin: var(--av-space-1) 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-log__meta span + span::before {
    content: "·";
    margin-inline: var(--av-space-1-5);
    color: var(--av-border-strong);
  }
  .av-log__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--av-space-1-5);
    flex: none;
  }
  /* Tabular figures so the column of times aligns on the colon; without it a
     run of timestamps reads as ragged even though every one is five glyphs. */
  .av-log__time {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums lining-nums;
    white-space: nowrap;
  }
  /* ── Filters ──────────────────────────────────────────────────────────
     Chips rather than the underlined tabs `.av-feed` uses. The feed has three
     and lives in a drawer; this has six on a full-width card, and six
     underlines read as a second navigation bar under the one the page already
     has. Wired to `initNotifFilters`, which hides rather than removes — see
     the module for why the DOM you tabbed into has to be the DOM that
     comes back. */
  .av-log__filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    padding: 0 var(--av-space-5) var(--av-space-4);
  }
  .av-log__filter {
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-base);
    padding-block: var(--av-space-1-5);
    padding-inline: var(--av-space-3);
    font: inherit;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-secondary);
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-log__filter:hover {
    border-color: var(--av-border-strong);
    color: var(--av-text-primary);
  }
  /* The selected chip is mixed against the card rather than set to
     `--av-color-primary-subtle`, which is `--av-primary-50` — 97% lightness at
     0.015 chroma, against a resting chip already sitting at 97% and 0.004. Two
     colours a hundredth of a unit apart is a selection you cannot see, which is
     the same failure as a filter that does nothing. The border carries the full
     primary for the same reason: a pale fill needs an edge to be read as a
     state rather than as a rendering artefact. */
  .av-log__filter[aria-pressed=true] {
    background: color-mix(in oklab, var(--av-color-primary) 14%, var(--av-surface-raised));
    border-color: var(--av-color-primary);
    color: var(--av-color-primary-text);
  }
  .av-log__filter:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  .av-log__empty {
    margin: 0;
    padding: var(--av-space-8) var(--av-space-5);
    text-align: center;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  /* One accent per kind, set once and read by the mark. Same shape as
     `.av-role-card`: a new kind is a modifier, not four more rules. */
  .av-log__mark--success {
    --av-log-accent: var(--av-color-success);
    --av-log-tint: var(--av-color-success-subtle);
  }
  .av-log__mark--warning {
    --av-log-accent: var(--av-color-warning);
    --av-log-tint: var(--av-color-warning-subtle);
  }
  .av-log__mark--danger {
    --av-log-accent: var(--av-color-danger);
    --av-log-tint: var(--av-color-danger-subtle);
  }
  .av-log__mark--info {
    --av-log-accent: var(--av-color-info);
    --av-log-tint: var(--av-color-info-subtle);
  }
  .av-log__mark--primary {
    --av-log-accent: var(--av-color-primary);
    --av-log-tint: var(--av-color-primary-subtle);
  }
  /* Written out rather than left to the fallbacks it happens to match. A class
     in the markup that resolves to nothing is a class the next person deletes
     from the stylesheet and then cannot find in the HTML. */
  .av-log__mark--neutral {
    --av-log-accent: var(--av-text-secondary);
    --av-log-tint: var(--av-color-neutral-subtle);
  }
  /* Below the aside's width there is no third track worth keeping: the time
     and the badge would each take a line of their own and push the sentence
     into three. They move under the body instead, on one row. */
  @media (width < 48rem) {
    .av-log__item {
      grid-template-columns: auto 1fr;
      padding-inline: var(--av-space-4);
    }
    .av-log__aside {
      grid-column: 2;
      flex-direction: row;
      align-items: center;
      justify-content: flex-start;
      gap: var(--av-space-2);
      margin-block-start: var(--av-space-2);
    }
    .av-log__date,
    .av-log__filters {
      padding-inline: var(--av-space-4);
    }
  }
  /* ── The rail ─────────────────────────────────────────────────────────
     Two small lists beside the log. They were a `<dl>` of four label/value
     pairs, which is the right *markup* for a set of figures and the wrong
     amount of weight: four numbers in body text beside a full-height log read
     as a caption rather than as a summary. Reusing `.av-log__mark` for the
     icon is deliberate — the rail's shield is the same shield as the log's
     security rows, so the two halves of the page agree about what a kind
     looks like. */
  .av-log-stats,
  .av-log-people {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--av-space-3);
  }
  .av-log-stat,
  .av-log-person {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    font-size: var(--av-font-size-sm);
  }
  .av-log-stat__label,
  .av-log-person__name {
    flex: 1;
    min-inline-size: 0;
    color: var(--av-text-secondary);
  }
  .av-log-stat__value {
    flex: none;
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-log-person__name {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-medium);
  }
  .av-log-person__count {
    flex: none;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums lining-nums;
  }
}
@layer components {
  .av-alert {
    display: flex;
    gap: var(--av-space-3);
    padding: var(--av-space-4);
    border-radius: var(--av-radius-md);
    border: 1px solid transparent;
  }
  /* An alert that introduces the block beneath it rather than standing alone.
     A page-level alert takes its gap from the page rhythm in `layout/_shell.scss`
     and `layout/_public.scss`, but that rhythm reaches only direct children of
     the page body: an alert nested in a card body, a split pane or a plain
     `<section>` is outside it, and four sat flush against what they introduced —
     the stats strips on `posts.html` and `deals.html`, the lead grid on
     `leads.html`, and the mail pane, which had bought itself the gap with an
     inline `style=` no lint gate can read.

     It stays an author-applied modifier, and the two structural forms were both
     written and both reverted. `.av-alert + <block>` has to name every block
     type that can follow one, and the one it forgets ships flush — the defect
     already recorded against `.av-field + .av-field`. A blanket
     `:where(.av-alert:not(:last-child))` trailing margin is worse: it collapses
     harmlessly into the rhythm in block flow, but a parent that owns its gap
     through `gap` has nothing to collapse with, so it *added* to it — the three
     stacked examples on `ui/feedback.html` went from 16px to 32px the moment it
     compiled. A gap belongs either to the container or to the author, and here
     the container cannot know.

     What makes a modifier reliable is not the modifier: `tests/pages.mjs`
     measures the rendered gap under every alert on every page and fails on a
     flush one, so forgetting this is now a failing gate rather than a shipped
     page. */
  .av-alert--lead {
    margin-block-end: var(--av-space-4);
  }
  /* An alert inside a container that carries no padding of its own, where every
     other block supplies its own gutter — the mail pane, whose head and body
     each pad themselves off the pane edge. It brings the gutter with it, and
     needs no `--lead` because the block below is already padded away from it.
     This was 55 characters of inline `style=`, which no lint gate can read and
     no specificity ceiling applies to. */
  .av-alert--inset {
    margin-block: var(--av-space-5) 0;
    margin-inline: var(--av-space-5);
  }
  /* An author `display` beats the UA `[hidden]` rule at equal specificity, so a
     class that sets display needs its own. The error summary starts hidden. */
  .av-alert[hidden] {
    display: none;
  }
  .av-alert__icon {
    flex: 0 0 auto;
    margin-block-start: 1px;
  }
  .av-alert__body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-alert__title {
    /* The base :where(h1..h6) rule targets this heading directly, so it beats the
       colour inherited from the alert variant. Restate it. */
    color: inherit;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    margin: 0 0 2px;
  }
  .av-alert__text {
    font-size: var(--av-font-size-sm);
    margin: 0;
    opacity: 0.9;
  }
  /* Twenty-eight alerts carried one paragraph each and the twenty-ninth carried
     two — a derived sentence over the standing explanation of how it was
     derived — which rendered as one run-on block, because `margin: 0` is right
     for the only paragraph in a box and wrong for the second. Spaced from the
     pair rather than from the element, so a single paragraph is untouched. */
  .av-alert__text + .av-alert__text {
    margin-block-start: var(--av-space-2);
  }
  /* A link inside an alert, which twenty-seven alerts went without and the
     twenty-eighth needed.

     The default link colour is contrast-checked against the *page* surface, and
     an alert paints its own subtle fill underneath — so a link that keeps its
     own hue lands on a ground nobody measured it against. `tests/a11y.mjs`
     caught exactly that on the permissions page's "Roles and permissions" link,
     at 0 → 1 violations, on the first alert in the product to contain one. The
     same trap `.av-matrix__fixed` records one component along: a token that
     clears AA on the page does not automatically clear it on a raised fill.

     So it inherits the role's own `-text` step, which *is* checked against this
     fill, and the underline carries the affordance that the hue used to. */
  .av-alert__body a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .av-alert__body a:hover {
    text-decoration-thickness: 2px;
  }
  .av-alert__actions {
    display: flex;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-3);
  }
  .av-alert--success-soft {
    background: var(--av-color-success-subtle);
    border-color: var(--av-color-success-border);
    color: var(--av-color-success-text);
  }
  .av-alert--success-soft .av-alert__icon {
    color: var(--av-color-success);
  }
  .av-alert--warning-soft {
    background: var(--av-color-warning-subtle);
    border-color: var(--av-color-warning-border);
    color: var(--av-color-warning-text);
  }
  .av-alert--warning-soft .av-alert__icon {
    color: var(--av-color-warning);
  }
  .av-alert--danger-soft {
    background: var(--av-color-danger-subtle);
    border-color: var(--av-color-danger-border);
    color: var(--av-color-danger-text);
  }
  .av-alert--danger-soft .av-alert__icon {
    color: var(--av-color-danger);
  }
  .av-alert--info-soft {
    background: var(--av-color-info-subtle);
    border-color: var(--av-color-info-border);
    color: var(--av-color-info-text);
  }
  .av-alert--info-soft .av-alert__icon {
    color: var(--av-color-info);
  }
  .av-close {
    flex: none;
    display: grid;
    place-items: center;
    inline-size: 28px;
    block-size: 28px;
    border: 0;
    border-radius: var(--av-radius-sm);
    background: none;
    color: currentColor;
    opacity: 0.6;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-close:hover {
    opacity: 1;
  }
}
@layer components {
  /* Toasts ──────────────────────────────────────────────────────────── */
  .av-toast-region {
    position: fixed;
    inset-block-end: var(--av-space-4);
    inset-inline-end: var(--av-space-4);
    z-index: var(--av-z-toast);
    display: flex;
    flex-direction: column-reverse; /* newest nearest the eye */
    gap: var(--av-space-2);
    inline-size: min(400px, 100vw - var(--av-space-8));
    pointer-events: none;
  }
  .av-toast-region > * {
    pointer-events: auto;
  }
  @media (max-width: 575.98px) {
    .av-toast-region {
      inset-inline: var(--av-space-3);
      inline-size: auto;
      inset-block-end: calc(env(safe-area-inset-bottom) + var(--av-space-3));
    }
  }
  .av-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-radius: var(--av-radius-md);
    border: 1px solid var(--av-border-subtle);
    background: var(--av-surface-overlay);
    box-shadow: var(--av-shadow-lg);
    animation: av-toast-in var(--av-duration-normal) var(--av-ease-emphasized);
  }
  /* The stack. At rest, every toast but the newest tucks behind it with a
     sliver showing, so four messages cost one toast's height; pointer or
     focus inside the region fans them out to read. The runtime records each
     toast's place (--av-toast-index) and height (--av-toast-height), the two
     things CSS cannot know. Newest is first in the DOM and drawn on top. */
  .av-toast {
    position: relative;
    z-index: calc(var(--av-z-raised) - var(--av-toast-index, 0));
    transition: margin var(--av-duration-normal) var(--av-ease-standard), scale var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-toast-region:not(:hover, :focus-within) > .av-toast:not(:first-child) {
    margin-block-end: calc(-1 * var(--av-toast-height, 0px) + var(--av-space-2-5) - var(--av-space-2));
    scale: calc(1 - var(--av-toast-index, 0) * 0.04);
  }
  /* A tucked toast's text sits behind the newest one; fading it keeps the
     sliver from reading as a cut-off message. */
  .av-toast-region:not(:hover, :focus-within) > .av-toast:not(:first-child) > * {
    opacity: 0;
  }
  .av-toast > * {
    transition: opacity var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-toast.is-leaving {
    animation: av-toast-out var(--av-duration-fast) var(--av-ease-accelerate) forwards;
  }
  @keyframes av-toast-in {
    from {
      opacity: 0;
      translate: 0 12px;
      scale: 0.98;
    }
  }
  @keyframes av-toast-out {
    to {
      opacity: 0;
      translate: 0 8px;
      scale: 0.98;
    }
  }
  .av-toast__icon {
    flex: none;
    margin-block-start: 1px;
  }
  .av-toast--success .av-toast__icon {
    color: var(--av-color-success);
  }
  .av-toast--danger .av-toast__icon {
    color: var(--av-color-danger);
  }
  .av-toast--warning .av-toast__icon {
    color: var(--av-color-warning);
  }
  .av-toast--info .av-toast__icon {
    color: var(--av-color-info);
  }
  .av-toast__body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-toast__title {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  .av-toast__message {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    margin: 2px 0 0;
  }
  .av-toast__count {
    display: inline-grid;
    place-items: center;
    min-inline-size: 18px;
    block-size: 18px;
    padding-inline: 5px;
    margin-inline-start: var(--av-space-2);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  /* An author `display` beats the UA's [hidden] rule regardless of specificity. */
  .av-toast__count[hidden] {
    display: none;
  }
  .av-toast__action {
    background: none;
    border: 0;
    padding: 0;
    margin-block-start: var(--av-space-2);
    color: var(--av-text-link);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
  }
}
@layer components {
  /* Save bar ────────────────────────────────────────────────────────────
     The visible half of `data-av-dirty-guard`. The guard already stops a
     reader leaving with unsaved changes; this bar says so *before* they try,
     and puts Save and Discard where the eye already is, at the bottom of the
     viewport while they scroll a long settings form. It lives inside the
     form, so its buttons are the form's own submit and reset with no script
     standing between them. The runtime only shows and hides it. */
  .av-save-bar {
    position: sticky;
    inset-block-end: var(--av-space-4);
    z-index: var(--av-z-sticky);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
    margin-block-start: var(--av-space-6);
    padding: var(--av-space-3) var(--av-space-3) var(--av-space-3) var(--av-space-5);
    border: 1px solid var(--av-border-inverse);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-inverse);
    color: var(--av-text-inverse);
    box-shadow: var(--av-shadow-xl);
    animation: save-bar-in var(--av-duration-normal) var(--av-ease-decelerate);
  }
  .av-save-bar[hidden] {
    display: none;
  }
  .av-save-bar__text {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
  }
  /* A dot in the warning role says "pending" without a word of colour theory. */
  .av-save-bar__text::before {
    content: "";
    inline-size: var(--av-space-2);
    block-size: var(--av-space-2);
    border-radius: var(--av-radius-full);
    background: var(--av-color-warning);
  }
  .av-save-bar__actions {
    display: flex;
    gap: var(--av-space-2);
  }
  /* The discard button sits on the inverse surface, so it takes the inverse
     ink rather than a ghost button's page colours. */
  .av-save-bar .av-btn--ghost {
    color: var(--av-text-inverse);
  }
  .av-save-bar .av-btn--ghost:hover {
    background: color-mix(in oklab, var(--av-text-inverse) 12%, transparent);
    color: var(--av-text-inverse);
  }
  @keyframes save-bar-in {
    from {
      opacity: 0;
      translate: 0 var(--av-space-3);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .av-save-bar {
      animation: none;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-save-bar {
    animation: none;
  }
}
@layer components {
  /* Hero band ───────────────────────────────────────────────────────────
     The one expressive moment a dashboard is allowed: a greeting, the date
     and the figures that matter today, on a band of the preset's own colour.
     Everything else on the page stays calm, which is what makes this read as
     the top of the page rather than one more loud card.

     The fill is the primary deepened to at most 42% lightness, the same rule
     the vivid KPI tile uses, so white ink clears 4.5:1 on every preset by
     construction rather than by luck. The accent tints one corner so the band
     carries the preset's pairing, not a single flat hue. */
  .av-hero-band {
    --av-hero-fill: oklch(from var(--av-color-primary) min(l, .42) c h);
    --av-hero-ink: var(--av-neutral-0);
    position: relative;
    display: grid;
    gap: var(--av-space-6);
    padding: var(--av-space-8);
    overflow: hidden;
    border-radius: var(--av-radius-2xl);
    background: radial-gradient(ellipse 60% 90% at 100% 0%, color-mix(in oklab, var(--av-accent-500) 32%, transparent) 0%, transparent 70%), linear-gradient(135deg, oklch(from var(--av-hero-fill) calc(l + 0.03) c h) 0%, var(--av-hero-fill) 60%, oklch(from var(--av-hero-fill) calc(l - 0.04) c h) 100%);
    color: var(--av-hero-ink);
    box-shadow: var(--av-shadow-lg), 0 18px 40px -20px oklch(from var(--av-hero-fill) l c h/0.6);
  }
  .av-hero-band__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--av-space-4);
  }
  /* The base heading rule paints every h1 to h6 with --av-text-primary, which
     is dark in light mode; on the band the heading takes the band's ink. */
  .av-hero-band__title {
    margin: 0;
    color: inherit;
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-3xl);
    font-weight: var(--av-font-weight-bold);
    line-height: var(--av-line-height-tight);
    letter-spacing: var(--av-tracking-tight);
  }
  .av-hero-band__text {
    margin: var(--av-space-2) 0 0;
    color: color-mix(in oklab, var(--av-hero-ink) 84%, transparent);
  }
  .av-hero-band__date {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-1-5) var(--av-space-3);
    border: 1px solid color-mix(in oklab, var(--av-hero-ink) 24%, transparent);
    border-radius: var(--av-radius-full);
    background: color-mix(in oklab, var(--av-hero-ink) 10%, transparent);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    white-space: nowrap;
  }
  /* The day's figures, on frosted tiles of the band's own ink. */
  .av-hero-band__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: var(--av-space-4);
    margin: 0;
  }
  .av-hero-band__stat {
    display: grid;
    gap: var(--av-space-1);
    padding: var(--av-space-4);
    border: 1px solid color-mix(in oklab, var(--av-hero-ink) 18%, transparent);
    border-radius: var(--av-radius-lg);
    background: color-mix(in oklab, var(--av-hero-ink) 9%, transparent);
  }
  .av-hero-band__label {
    font-size: var(--av-font-size-sm);
    color: color-mix(in oklab, var(--av-hero-ink) 84%, transparent);
  }
  .av-hero-band__value {
    margin: 0;
    font-size: var(--av-font-size-2xl);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--av-tracking-tight);
  }
  .av-hero-band__delta {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: color-mix(in oklab, var(--av-hero-ink) 84%, transparent);
  }
  @media (max-width: 575.98px) {
    .av-hero-band {
      padding: var(--av-space-5);
      gap: var(--av-space-4);
    }
    .av-hero-band__title {
      font-size: var(--av-font-size-2xl);
    }
    .av-hero-band__stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--av-space-3);
    }
  }
}
@layer components {
  /* Dialogs: native <dialog> gives focus trap, Esc, inert page, restore ── */
  .av-dialog {
    inline-size: min(520px, 100vw - var(--av-space-8));
    max-block-size: min(85dvh, 720px);
    /* The reset's `* { margin: 0 }` overrides the UA `margin: auto` that centres a dialog. */
    margin: auto;
    padding: 0;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-overlay);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-2xl);
    overflow: visible;
  }
  .av-dialog--lg {
    inline-size: min(800px, 100vw - var(--av-space-8));
  }
  .av-dialog--sm {
    inline-size: min(400px, 100vw - var(--av-space-8));
  }
  .av-dialog::backdrop {
    background: var(--av-overlay);
    backdrop-filter: blur(2px);
  }
  .av-dialog[open] {
    animation: av-dialog-in var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-dialog[open]::backdrop {
    animation: av-fade-in var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-dialog.is-closing {
    animation: av-dialog-out var(--av-duration-fast) var(--av-ease-accelerate) forwards;
  }
  @keyframes av-dialog-in {
    from {
      opacity: 0;
      translate: 0 16px;
      scale: 0.97;
    }
  }
  @keyframes av-dialog-out {
    to {
      opacity: 0;
      translate: 0 8px;
      scale: 0.98;
    }
  }
  @keyframes av-fade-in {
    from {
      opacity: 0;
    }
  }
  .av-dialog__inner {
    display: flex;
    flex-direction: column;
    max-block-size: inherit;
  }
  .av-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--av-space-3);
    padding: var(--av-space-5) var(--av-space-5) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-dialog__title {
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  .av-dialog__body {
    padding: var(--av-space-5);
    overflow-y: auto;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  /* Wraps, because three actions (Deny, Allow once, Always allow) do not fit
     a 360px dialog on one line, and a footer that cannot wrap pushes the
     primary action off the edge, which is the one a reader came to press. */
  .av-dialog__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--av-space-2);
    padding: var(--av-space-4) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-dialog__icon {
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    flex: none;
    border-radius: var(--av-radius-full);
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger);
  }
  .av-dialog__icon--primary {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary);
  }
  .av-dialog__icon--warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning);
  }
  .av-confirm__head {
    display: flex;
    gap: var(--av-space-4);
    padding: var(--av-space-5);
  }
  .av-confirm__text {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    margin: var(--av-space-1) 0 0;
  }
  /* The type-to-confirm field. It only ever appears under `.av-confirm__text`,
     so the space above it is the gap between the warning and the thing that
     acts on it, not the field's own margin. */
  .av-confirm__ack {
    margin-block: var(--av-space-4) 0;
  }
  /* The sentence a dialog opens with, before its controls. Secondary ink,
     because the heading above it has already said what the dialog is for. */
  .av-dialog__lead {
    color: var(--av-text-secondary);
  }
}
@layer components {
  /* Dropdown ────────────────────────────────────────────────────────── */
  .av-dropdown {
    position: relative;
    display: inline-flex;
  }
  .av-dropdown__menu {
    position: absolute;
    inset-block-start: calc(100% + var(--av-space-1));
    inset-inline-end: 0;
    z-index: var(--av-z-popover);
    min-inline-size: 200px;
    padding: var(--av-space-1-5);
    margin: 0;
    list-style: none;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-overlay);
    box-shadow: var(--av-shadow-lg);
    opacity: 0;
    visibility: hidden;
    translate: 0 -6px;
    scale: 0.98;
    transform-origin: top center;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard), translate var(--av-duration-fast) var(--av-ease-standard), scale var(--av-duration-fast) var(--av-ease-standard), visibility 0s linear var(--av-duration-fast);
  }
  /* A panel floating over real content is the one place the blur does work.
     The panel stays nearly opaque, though: this is a reading surface, and at
     88% a high-contrast thing behind it — a filled button, a stat card — showed
     straight through the text. The glass is a hint of depth at the edges, not
     a transparency effect the content has to compete with. */
  @supports (backdrop-filter: blur(1px)) {
    .av-dropdown__menu {
      background: color-mix(in oklab, var(--av-surface-overlay) 97%, transparent);
      backdrop-filter: blur(20px) saturate(180%);
    }
  }
  .av-dropdown__menu--start {
    inset-inline: 0 auto;
  }
  /* Escaping the clip ──────────────────────────────────────────────────
     An absolutely positioned menu is at the mercy of its ancestors. A card that
     establishes a stacking context paints the next card over it; a
     `.av-table-wrap` or an example preview with `overflow-x: auto` clips it
     outright. No z-index fixes either, because z-index only orders siblings
     within a stacking context and `overflow` does not consult it at all.

     So the menu leaves. `initDropdowns` promotes it to a popover on first open,
     which puts it in the **top layer** — above every stacking context, outside
     every scroll container, with no portalling and no change to the markup you
     wrote. `manual` rather than `auto`: light dismiss would close the panel
     before an in-panel control (`data-av-dropdown-keep`) could act on it, and
     the module already owns outside-click and Escape.

     The UA sheet gives a popover `inset: 0` and `margin: auto` to centre it;
     both have to go, because JS is placing this one against its trigger. */
  .av-dropdown__menu[popover] {
    position: fixed;
    inset: auto;
    margin: 0;
    max-block-size: min(70vh, 32rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* Placed above its trigger when there is no room below — the transform origin
     follows, so it still grows out of the button rather than into it.
     Only the closed state needs stating: `.av-dropdown.is-open
     .av-dropdown__menu` is 0-3-0 and already resets `translate` for both
     placements. Repeating it here would be 0-4-0, over the ceiling, for a rule
     that changes nothing. */
  .av-dropdown__menu[data-av-placement=top] {
    transform-origin: bottom center;
    translate: 0 6px;
  }
  .av-dropdown.is-open .av-dropdown__menu {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
    scale: 1;
    transition-delay: 0s;
  }
  .av-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    inline-size: 100%;
    padding: var(--av-space-2) var(--av-space-2-5);
    border: 0;
    border-radius: var(--av-radius-sm);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    text-align: start;
    text-decoration: none;
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard);
  }
  .av-dropdown__item:hover, .av-dropdown__item:focus-visible {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-dropdown__item--danger {
    color: var(--av-color-danger-text);
  }
  .av-dropdown__item--danger:hover {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-dropdown__divider {
    block-size: 1px;
    margin: var(--av-space-1-5) 0;
    background: var(--av-border-subtle);
  }
  .av-dropdown__label {
    padding: var(--av-space-2) var(--av-space-2-5) var(--av-space-1);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wider);
    text-transform: uppercase;
    color: var(--av-text-muted);
  }
}
@layer components {
  /* Notifications ───────────────────────────────────────────────────────
     The panel rides on .av-dropdown, so open/close, outside-click, Escape and
     arrow-key roving all come from initDropdowns() rather than a second
     implementation. Rows are .av-dropdown__item for exactly that reason.

     It is deliberately NOT role="menu": a menu promises a list of commands, and
     this holds links, a timestamp and a dismiss button per row. Screen readers
     announce the wrong affordances for the wrong thing. */
  .av-notif {
    position: relative;
    display: inline-flex;
  }
  .av-notif__badge {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    display: grid;
    place-items: center;
    min-inline-size: 17px;
    block-size: 17px;
    padding-inline: 4px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-danger);
    /* The danger fill is lighter in dark mode: its own text token keeps the count at 4.5:1 there. */
    color: var(--av-text-on-danger);
    font-size: 10px;
    font-weight: var(--av-font-weight-bold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    /* The ring punches the badge out of the icon beneath it. */
    box-shadow: 0 0 0 2px var(--av-surface-raised);
  }
  /* The pulse advertises unread mail; a read tray must sit still. */
  .av-notif__badge--pulse {
    animation: av-notif-pulse 3s var(--av-ease-standard) infinite;
  }
  @keyframes av-notif-pulse {
    0%, 65%, 100% {
      box-shadow: 0 0 0 2px var(--av-surface-raised), 0 0 0 0 color-mix(in oklab, var(--av-color-danger) 55%, transparent);
    }
    32% {
      box-shadow: 0 0 0 2px var(--av-surface-raised), 0 0 0 6px color-mix(in oklab, var(--av-color-danger) 0%, transparent);
    }
  }
  .av-notif__panel {
    inline-size: min(380px, 100vw - var(--av-space-6));
    padding: 0;
    overflow: hidden;
  }
  .av-notif__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-notif__title {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-notif__count {
    margin-inline-start: var(--av-space-2);
    padding: 1px var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  .av-notif__mark {
    border: 0;
    background: none;
    padding: var(--av-space-1) var(--av-space-1-5);
    margin-inline-end: calc(var(--av-space-1-5) * -1);
    border-radius: var(--av-radius-sm);
    color: var(--av-text-link);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard);
  }
  .av-notif__mark:hover {
    background: var(--av-surface-sunken);
  }
  .av-notif__mark:disabled {
    color: var(--av-text-disabled);
    background: none;
  }
  .av-notif__list {
    max-block-size: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: var(--av-space-1);
    list-style: none;
  }
  /* Row. Grid rather than flex so the dismiss button can sit in its own track
     and the text wraps against a fixed column instead of shoving it about. */
  .av-notif__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: var(--av-space-3);
    padding: var(--av-space-2-5);
    position: relative;
  }
  .av-notif__item.is-unread {
    background: color-mix(in oklab, var(--av-color-primary) 5%, transparent);
  }
  .av-notif__item.is-unread:hover {
    background: color-mix(in oklab, var(--av-color-primary) 9%, transparent);
  }
  .av-notif__icon {
    display: grid;
    place-items: center;
    inline-size: 32px;
    block-size: 32px;
    flex: none;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-notif__icon .av-icon {
    inline-size: 16px;
    block-size: 16px;
  }
  .av-notif__icon--success {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-notif__icon--warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
  }
  .av-notif__icon--danger {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-notif__icon--info {
    background: var(--av-color-info-subtle);
    color: var(--av-color-info-text);
  }
  .av-notif__body {
    min-inline-size: 0;
  }
  .av-notif__text {
    display: block;
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-snug);
    color: var(--av-text-secondary);
    white-space: normal;
  }
  .av-notif__text strong {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-notif__time {
    display: block;
    margin-block-start: var(--av-space-1);
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  /* Unread marker. Hidden rather than removed when read, so the row does not
     reflow the instant it is marked. */
  .av-notif__dot {
    inline-size: 7px;
    block-size: 7px;
    margin-block-start: var(--av-space-2);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    transition: opacity var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-notif__item:not(.is-unread) .av-notif__dot {
    opacity: 0;
  }
  .av-notif__empty {
    display: grid;
    justify-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-8) var(--av-space-5);
    text-align: center;
    color: var(--av-text-muted);
    font-size: var(--av-font-size-sm);
  }
  .av-notif__empty .av-icon {
    inline-size: 32px;
    block-size: 32px;
    color: var(--av-text-muted);
  }
  .av-notif__foot {
    padding: var(--av-space-2);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
  }
  .av-notif__all {
    display: block;
    padding: var(--av-space-2);
    border-radius: var(--av-radius-sm);
    color: var(--av-text-link);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    text-align: center;
    text-decoration: none;
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard);
  }
  .av-notif__all:hover {
    background: var(--av-surface-raised);
  }
}
@layer components {
  /* Notification feed ───────────────────────────────────────────────────
     The rows a notifications drawer holds. Deliberately its own component
     rather than a modifier on `.av-notif`: `.av-notif` is the trigger and its
     badge, which stay in the topbar, and a feed is a list that could just as
     well sit on a page. Keeping them apart is what lets the activity page use
     these rows later without dragging a bell along.

     The unread mark is a bar on the inline start rather than a background
     tint, for two reasons: a tint plus the row's own hover state is two
     backgrounds fighting, and a bar survives a preset whose surfaces are
     already tinted. The state is *also* carried in text — every unread row
     opens with a visually-hidden "Unread." — because colour alone is not a
     status anybody can hear. */
  .av-feed {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    min-block-size: 0;
  }
  .av-feed__head-actions {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
  }
  .av-feed__tabs {
    display: flex;
    gap: var(--av-space-1);
    padding: var(--av-space-3) var(--av-space-5) 0;
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-feed__tab {
    border: 0;
    background: none;
    padding: var(--av-space-2) var(--av-space-3);
    font: inherit;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
    cursor: pointer;
    /* Transparent in the resting state rather than added on the active one, so
       the row does not shift by 2px when the selection moves. */
    border-block-end: 2px solid transparent;
    margin-block-end: -1px;
  }
  .av-feed__tab:hover {
    color: var(--av-text-primary);
  }
  .av-feed__tab[aria-pressed=true] {
    color: var(--av-color-primary-text);
    border-block-end-color: var(--av-color-primary);
  }
  .av-feed__tab:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  .av-feed__list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-feed__group {
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
    padding: var(--av-space-4) 0 var(--av-space-2);
  }
  .av-feed__group:first-child {
    padding-block-start: 0;
  }
  .av-feed__item {
    display: flex;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-3) var(--av-space-3) var(--av-space-4);
    border-radius: var(--av-radius-lg);
    position: relative;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-feed__item:hover {
    background: var(--av-surface-sunken);
  }
  /* A notification that opens something is a link: the whole row is the
     target, so it reads as a row, not as underlined link text. */
  a.av-feed__item {
    color: inherit;
    text-decoration: none;
  }
  .av-feed__item.is-unread::before {
    content: "";
    position: absolute;
    inset-block: var(--av-space-3);
    inset-inline-start: 0;
    inline-size: 3px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
  }
  .av-feed__avatar {
    flex: none;
  }
  .av-feed__icon {
    flex: none;
    inline-size: 32px;
    block-size: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
  }
  .av-feed__icon--success {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-feed__icon--warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
  }
  .av-feed__icon--danger {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-feed__body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-feed__title {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-feed__title strong {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-feed__meta {
    margin: 2px 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* The inline card is what separates a feed from a list of sentences: the
     action lives with the thing it acts on, so accepting a request never means
     navigating away and finding it again. */
  .av-feed__card {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    flex-wrap: wrap;
    margin-block-start: var(--av-space-2-5);
    padding: var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-base);
  }
  .av-feed__card-body {
    flex: 1;
    min-inline-size: 12ch;
  }
  .av-feed__card-title {
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-feed__card-meta {
    margin: 2px 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-feed__card-actions {
    display: flex;
    gap: var(--av-space-2);
    flex: none;
  }
  .av-feed__file {
    flex: none;
    inline-size: 36px;
    block-size: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--av-radius-md);
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-feed__labels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-1-5);
    margin-block-start: var(--av-space-2);
  }
  .av-feed__foot {
    display: flex;
    gap: var(--av-space-2);
  }
  .av-feed__foot > * {
    flex: 1;
  }
}
@layer components {
  /* Messages drawer ─────────────────────────────────────────────────────
     A rail of conversations on the inline start, one thread beside it, one
     composer under the thread. The header spans both columns.

     **This replaces a four-row stack, and the row it removes is the point.**
     The switcher used to be a horizontal `.av-tabs` with `overflow-x: auto`
     and a 200px minimum per tab, which at the drawer's width showed two
     conversations and a scrollbar — and that scrollbar sat directly above the
     thread's own, so there were two bars of chrome between the title and the
     first message. Turned on its side it shows eight conversations in the same
     space, needs no horizontal scroll at all, and hands the whole height of the
     drawer back to the thread, which is the thing a person came here to read.

     The bubbles are still `.av-message` from `components/_chat.scss`. What this
     partial adds is depth, a rail, a thread header and a composer that is one
     control rather than three things in a row. */
  .av-msg-drawer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-block-size: 0;
  }
  /* ── Header ───────────────────────────────────────────────────────────
     The one band that says which product this drawer belongs to. Painted from
     the brand gradient rather than a flat tint, so it re-themes with the preset
     and a sixteenth theme arrives already dressed. `--av-gradient-brand-soft`
     is two 10% mixes into transparent, so it *composites onto* the surface
     underneath rather than replacing it — which is why the surface is the
     second layer here rather than a separate rule. */
  .av-msg-drawer__head {
    grid-column: 1/-1;
    background: var(--av-gradient-brand-soft), var(--av-surface-raised);
  }
  .av-msg-drawer__head .av-drawer__title {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
  }
  .av-msg-drawer__head-actions {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
    flex: none;
  }
  /* ── Conversation rail ────────────────────────────────────────────────
     The tablist is a plain `role="tablist"` and the tiles carry none of
     `.av-tabs`' classes. `initTabs` binds on `[role="tab"]`, so the ARIA
     pattern — roving tabindex, arrow keys, panel wiring — comes across intact
     while none of the strip's *painting* does; `aria-orientation="vertical"` is
     the one thing the module needs told, and Up/Down were already wired.

     Borrowing `.av-tabs__tab` and overriding it is the tempting version and it
     is the trap this codebase has already sprung three times: `.av-tabs__tab`
     sets `background: none` at 0-1-0 and every rule here that repaints the tile
     would be 0-1-0 too, leaving `@use` order to decide which one wins. Forty
     lines of its own beats one line that depends on an import list.

     The "new conversation" control sits *outside* the tablist. A child of a
     tablist that is not a tab is an ARIA error, and the roving tabindex would
     walk onto it. */
  .av-msg-drawer__rail {
    grid-column: 1;
    /* Full height, past the composer: a rail that stops where the thread stops
       leaves a notch beside the composer that reads as a missing panel. */
    grid-row: 2/-1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-2);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-inline-end: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    /* The rail is 64px wide. A scrollbar in it would be a fifth of that. */
    scrollbar-width: none;
  }
  .av-msg-drawer__convs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--av-space-1);
  }
  /* The tile colour travels as a variable rather than being restated three
     times, because two other things have to match it: the ring punched around
     the unread count, and the ring around the presence dot. Both are holes in
     whatever the tile currently is, and hard-coding the rail's ground into them
     leaves a pale halo on the selected tile. */
  .av-msg-drawer__conv {
    --av-msg-tile: var(--av-surface-sunken);
    position: relative;
    display: grid;
    place-items: center;
    inline-size: 48px;
    block-size: 48px;
    padding: 0;
    border: 0;
    border-radius: var(--av-radius-lg);
    background: var(--av-msg-tile);
    color: var(--av-text-secondary);
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-msg-drawer__conv:hover {
    --av-msg-tile: var(--av-surface-raised);
  }
  .av-msg-drawer__conv[aria-selected=true] {
    --av-msg-tile: var(--av-color-primary-subtle);
    box-shadow: inset 0 0 0 1px var(--av-color-primary-border);
  }
  /* The open conversation gets a bar on its leading edge. It sits *inside* the
     tile rather than out in the rail's padding, and that is not a taste
     decision: the rail is `overflow-y: auto`, and a box with one axis set to
     `auto` computes the other to `auto` as well — so a marker at a negative
     inline offset is clipped by the very element it was meant to hang off.
     It scales rather than appears, which is what makes switching read as one
     movement rather than two. */
  .av-msg-drawer__conv::after {
    content: "";
    position: absolute;
    inset-inline: 0 auto;
    inset-block: var(--av-space-3);
    inline-size: 3px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    scale: 1 0;
    transition: scale var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-msg-drawer__conv[aria-selected=true]::after {
    scale: 1 1;
  }
  /* The presence dot punches a hole in the tile, not in the page surface the
     avatar partial assumes. */
  .av-msg-drawer__conv .av-avatar--status::after {
    border-color: var(--av-msg-tile);
  }
  /* Unread count. `aria-hidden`, because the tab's accessible name already
     carries "2 unread" — a reader that picks the digit off the badge announces
     a number with no noun attached, the same reasoning as the bell. It rides
     the avatar's shoulder rather than the tile's far corner: the tile is 48px
     around a 36px disc, and anchored to the tile the badge floats in the gap
     with nothing to belong to. */
  .av-msg-drawer__conv-count {
    position: absolute;
    inset-block-start: 4px;
    inset-inline-end: 4px;
    min-inline-size: 16px;
    padding-inline: var(--av-space-1);
    border-radius: var(--av-radius-full);
    background: var(--av-color-danger);
    color: var(--av-text-on-danger);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--av-msg-tile);
  }
  /* Directly under the list, not pinned to the foot of the rail. Pinned, it
     leaves a column of empty rail between the last conversation and itself that
     reads as a list that failed to load the rest. */
  .av-msg-drawer__rail-new {
    display: grid;
    place-items: center;
    inline-size: 48px;
    block-size: 48px;
    flex: none;
    border: 1px dashed var(--av-border-default);
    border-radius: var(--av-radius-lg);
    color: var(--av-text-muted);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-msg-drawer__rail-new:hover {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  /* ── Thread ───────────────────────────────────────────────────────────
     Three rows of its own: who you are talking to, the log, and anything
     hanging under the log that is not part of the conversation. */
  .av-msg-drawer__thread {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-block-size: 0;
    /* A whisper of the brand behind the bubbles. It is on the thread rather
       than on the log because the log is masked (below) and a masked
       background would fade its own top edge into a seam. */
    background-image: var(--av-gradient-brand-soft);
  }
  /* The rail is initials only, so without this the drawer never names the
     conversation it is showing — which is fine until two colleagues share a
     pair of initials. It also gives the thread's own actions somewhere to live
     that is not the drawer header, where they would act on the wrong scope. */
  .av-msg-drawer__peer {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
  }
  .av-msg-drawer__peer-body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-msg-drawer__peer-name {
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-msg-drawer__peer-meta {
    display: flex;
    align-items: center;
    gap: var(--av-space-1-5);
    margin: 2px 0 0;
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  .av-msg-drawer__peer-actions {
    display: flex;
    gap: var(--av-space-1);
    flex: none;
  }
  .av-msg-drawer__thread .av-chat__messages {
    gap: var(--av-space-4);
    scrollbar-width: thin;
    scrollbar-color: var(--av-border-strong) transparent;
    /* The bubble at the top of a scrolled log used to be cut clean in half by
       the header's edge, which reads as a clipping bug rather than as more
       conversation above it. A short mask dissolves it instead — and only at
       the top: fading the *bottom* would put the newest message, the one thing
       in here nobody should have to squint at, under the gradient. */
    mask-image: linear-gradient(to bottom, transparent 0, black var(--av-space-5), black 100%);
  }
  /* ── Bubbles ──────────────────────────────────────────────────────────
     The shell is the chat app's `.av-message`; what changes here is depth. A
     flat tinted rectangle on a flat surface is most of why this drawer read as
     unfinished — two greys a hair apart with nothing between them saying one
     sits *on* the other. An incoming bubble is now a raised surface with a
     hairline and a shadow; your own is the brand gradient with the brand glow,
     the same recipe `.av-btn--primary` uses, so the two cannot drift apart. */
  .av-msg-drawer__thread .av-message__text {
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    box-shadow: var(--av-shadow-xs);
  }
  .av-msg-drawer__thread .av-message--own .av-message__text {
    background: var(--av-gradient-brand);
    border-color: transparent;
    color: var(--av-text-on-primary);
    box-shadow: var(--av-glow-primary);
  }
  /* `plain` is a document-level axis and it means flat surfaces. A drawer that
     ignores it is a drawer the axis cannot switch, which is the whole reason
     depth is an axis rather than a class. */
  [data-av-depth=plain] .av-msg-drawer__thread .av-message__text {
    box-shadow: none;
  }
  [data-av-depth=plain] .av-msg-drawer__thread .av-message--own .av-message__text {
    background: var(--av-color-primary);
  }
  /* The bubbles arrive rather than appear: 8px and a fade, staggered 40ms
     apart. It is capped at the seven that fit above the fold — a stagger that
     keeps counting past the viewport delays a message nobody is looking at,
     and on a long thread the last one would land half a second late. */
  .av-msg-drawer__thread .av-message {
    animation: av-msg-rise var(--av-duration-normal) var(--av-ease-emphasized) backwards;
  }
  .av-msg-drawer__thread .av-message:nth-child(2) {
    animation-delay: 40ms;
  }
  .av-msg-drawer__thread .av-message:nth-child(3) {
    animation-delay: 80ms;
  }
  .av-msg-drawer__thread .av-message:nth-child(4) {
    animation-delay: 120ms;
  }
  .av-msg-drawer__thread .av-message:nth-child(5) {
    animation-delay: 160ms;
  }
  .av-msg-drawer__thread .av-message:nth-child(6) {
    animation-delay: 200ms;
  }
  .av-msg-drawer__thread .av-message:nth-child(7) {
    animation-delay: 240ms;
  }
  @keyframes av-msg-rise {
    from {
      opacity: 0;
      translate: 0 8px;
    }
  }
  /* `backwards` holds the `from` state through the delay, so switching this off
     has to restore opacity as well as stop the motion — `animation: none`
     alone would leave a message that never fades in. */
  @media (prefers-reduced-motion: reduce) {
    .av-msg-drawer__thread .av-message {
      animation: none;
      opacity: 1;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-msg-drawer__thread .av-message {
    animation: none;
    opacity: 1;
  }
  /* Read receipt. Muted by default and brand-coloured once the message has
     actually been read, so the two states differ by more than a word — the
     shape of the ticks is the same and only the emphasis moves. */
  .av-message__receipt {
    display: flex;
    align-items: center;
    /* The receipt belongs to the bubble, so on an own message it follows it to
       the inline end. `flex-end` rather than a text-align, because this is a
       flex row of an icon and a word. */
    justify-content: flex-end;
    gap: var(--av-space-1);
    margin: var(--av-space-1) 0 0;
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  /* Read is the state worth distinguishing, and it earns the brand colour;
     sent and delivered stay muted so "read" is the only thing that stands out. */
  .av-message__receipt--read {
    color: var(--av-color-primary-text);
  }
  /* ── The thread sits on the composer ──────────────────────────────────
     A short conversation used to float at the top of the pane with a column of
     empty surface under it, which reads as a loading state that never
     finished. `auto` on the leading margin of the first child pushes a short
     log down to the composer and does nothing at all once the log is long
     enough to scroll — the standard flex trick, and the reason this is not
     `justify-content: flex-end`, which would pin the *scrolled* content to the
     bottom and make the top of a long conversation unreachable. */
  .av-msg-drawer__thread .av-chat__messages > :first-child {
    margin-block-start: auto;
  }
  /* ── Join request ─────────────────────────────────────────────────────
     A request to join sits under the log rather than inside it, because it is
     not part of the conversation and must not be read as one. The accent edge
     is what says so: a plain slab in the same greys as the bubbles above it is
     read as one more message with buttons on it. */
  .av-msg-drawer__request {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    flex-wrap: wrap;
    margin: 0 var(--av-space-4) var(--av-space-4);
    padding: var(--av-space-3);
    border: 1px solid var(--av-color-primary-border);
    border-inline-start: 3px solid var(--av-color-primary);
    border-radius: var(--av-radius-lg);
    background: var(--av-color-primary-subtle);
  }
  .av-msg-drawer__request-body {
    flex: 1;
    min-inline-size: 12ch;
  }
  .av-msg-drawer__request-title {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-msg-drawer__request-title strong {
    color: var(--av-text-primary);
  }
  .av-msg-drawer__request-meta {
    margin: 2px 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-msg-drawer__request-actions {
    display: flex;
    gap: var(--av-space-2);
    flex: none;
  }
  /* ── Composer ─────────────────────────────────────────────────────────
     One control, not three things in a row. The field, the two tools, the send
     hint and the send button share a single shell that lights on
     `:focus-within`, so the ring belongs to the thing a person believes they
     are typing into rather than to the bare textarea inside it. That is also
     what lets the textarea drop its own border without leaving a focusable
     control with no focus indication. */
  .av-msg-drawer__composer {
    grid-column: 2;
    grid-row: 3;
    display: grid;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-4) var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
  }
  /* Canned replies. The single highest-value control in a *drawer* specifically:
     someone who opened the messages panel from a page they were working on is
     acknowledging, not composing, and three taps beats three sentences. They
     scroll rather than wrap, because a second row would push the field down and
     change the height of the composer as the list grows. */
  .av-msg-drawer__quick {
    display: flex;
    gap: var(--av-space-2);
    overflow-x: auto;
    scrollbar-width: none;
    padding-block-end: 2px;
    /* A chip cut clean by the composer's edge reads as a clipping fault; the
       same chip dissolving reads as "there are more, scroll". No scrollbar,
       because a scrollbar on a 28px row is taller than half the row.

       A gradient has no logical direction keyword, so the direction travels as
       a custom property the `[dir="rtl"]` rule flips — the same tactic the
       sidebar sweep and the drawer's own slide already use. */
    --av-quick-fade: to right;
    mask-image: linear-gradient(var(--av-quick-fade), black 0, black calc(100% - var(--av-space-8)), transparent 100%);
  }
  [dir=rtl] .av-msg-drawer__quick {
    --av-quick-fade: to left;
  }
  .av-msg-drawer__quick-btn {
    flex: none;
    padding: var(--av-space-1) var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-msg-drawer__quick-btn:hover {
    border-color: var(--av-color-primary-border);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-msg-drawer__field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--av-space-1);
    padding: var(--av-space-2);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-base);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-msg-drawer__field:focus-within {
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 3px var(--av-color-primary-subtle);
  }
  .av-msg-drawer__field .av-textarea {
    grid-column: 1/-1;
    min-block-size: 0;
    padding: var(--av-space-1) var(--av-space-2);
    border: 0;
    border-radius: var(--av-radius-md);
    background: none;
    resize: none;
  }
  /* The shell already lit; a second ring inside it is two rings. */
  .av-msg-drawer__field .av-textarea:focus-visible {
    border-color: transparent;
    box-shadow: none;
  }
  .av-msg-drawer__tools {
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
  }
  /* Not a tooltip: the shortcut is only useful before you have tried the wrong
     key, and a tooltip is only reachable after you have gone looking. */
  .av-msg-drawer__hint {
    margin-inline-start: var(--av-space-1);
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  .av-msg-drawer__hint kbd {
    padding-inline: var(--av-space-1);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-xs);
    background: var(--av-surface-sunken);
    font: inherit;
  }
  .av-msg-drawer__send {
    --av-btn-height: 36px;
    grid-column: 2;
    align-self: end;
  }
  /* ── Narrow ───────────────────────────────────────────────────────────
     Under about 420px the drawer is the whole viewport, and 64px of rail is a
     sixth of it. The rail becomes a row above the thread — still vertical
     enough to read, and the tablist keeps working because orientation is an
     ARIA statement about the keys, not about the pixels. */
  @media (max-width: 26rem) {
    .av-msg-drawer {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto auto minmax(0, 1fr) auto;
    }
    .av-msg-drawer__head {
      grid-column: 1;
    }
    .av-msg-drawer__rail {
      grid-column: 1;
      grid-row: 2;
      flex-direction: row;
      gap: var(--av-space-2);
      overflow-x: auto;
      overflow-y: hidden;
      border-inline-end: 0;
      border-block-end: 1px solid var(--av-border-subtle);
    }
    .av-msg-drawer__convs {
      flex-direction: row;
    }
    .av-msg-drawer__thread {
      grid-column: 1;
      grid-row: 3;
    }
    .av-msg-drawer__composer {
      grid-column: 1;
      grid-row: 4;
    }
    /* Sideways, the marker belongs under the tile rather than beside it. */
    .av-msg-drawer__conv::after {
      inset-inline: var(--av-space-3);
      inset-block: auto 0;
      inline-size: auto;
      block-size: 3px;
      scale: 0 1;
    }
    .av-msg-drawer__conv[aria-selected=true]::after {
      scale: 1 1;
    }
  }
}
@layer components {
  /* Code ─────────────────────────────────────────────────────────────────
     A snippet block for reference pages. It scrolls inside its own box rather
     than widening its grid track: a <pre> is the classic way an over-wide
     descendant pushes .av-content past the viewport, which is exactly what
     tests/pages.mjs measures. */
  .av-code {
    margin: 0;
    /* Source code is left-to-right in every locale — it is not natural-language
       text and it does not follow the interface. Without this, a snippet under
       `dir="rtl"` overflows towards the inline start, which is *outside* the
       scroll container's start edge: the block scrolls the wrong way and the
       code runs off the side of the viewport. `tests/rtl.mjs` caught exactly
       that on the UI-kit overview. */
    direction: ltr;
    text-align: start;
    padding: var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-xs);
    line-height: var(--av-line-height-relaxed);
    overflow-x: auto;
    min-inline-size: 0;
    tab-size: 2;
  }
  .av-code code {
    font: inherit;
    color: inherit;
    white-space: pre;
  }
  /* Inline code inside prose. Isolated rather than merely LTR: a class name sits
     inside a right-to-left sentence, and without an isolate the bidi algorithm
     reorders the punctuation around it — `.av-btn--primary` comes out with its
     leading dot on the wrong end. */
  :not(pre) > code {
    direction: ltr;
    unicode-bidi: isolate;
    padding: 1px var(--av-space-1);
    border-radius: var(--av-radius-xs);
    background: var(--av-surface-sunken);
    color: var(--av-color-primary-text);
    font-family: var(--av-font-mono);
    font-size: 0.9em;
  }
  /* One-time codes ───────────────────────────────────────────────────────
     A grid of recovery codes. Nothing here listed codes before: `.av-secret`
     holds one value behind a mask, which is the opposite job — these are meant
     to be read, printed and taken away.

     A **used** code stays in the list, struck through, rather than being
     removed. A list that silently shrinks from ten to eight reads as a bug in
     the page; two struck out is a record of two sign-ins, which is what the
     reader came to check. `line-through` is paired with a note in words,
     because a strike alone is not announced. */
  .av-code-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: var(--av-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-code-list__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-sm);
    letter-spacing: 0.04em;
  }
  .av-code-list__item.is-used {
    color: var(--av-text-muted);
    background: none;
  }
  /* The strike goes on the code, never on the item. `text-decoration`
     propagates to descendants and a child cannot cancel it — `text-decoration:
     none` on the note below is simply ignored — so striking the row drew a line
     through "Used 2 June 2026" as well, which reads as the note being void
     rather than the code. */
  .av-code-list__item.is-used code {
    text-decoration: line-through;
  }
  .av-code-list__note {
    font-family: var(--av-font-sans);
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
    letter-spacing: normal;
  }
}
@layer components {
  /* Code editor ──────────────────────────────────────────────────────────
     The frame around CodeMirror, and deliberately *only* the frame.

     Every other vendor here is themed from a `plugins/` partial that restyles
     the vendor's own classes. That does not work for this one, and the reason
     is the cascade rather than anything about CodeMirror: its base theme is
     injected by style-mod as a plain `<style>` element at the top of `<head>`,
     with no `@layer` around it. An **unlayered** author declaration beats every
     layered one regardless of specificity or source order, so a
     `plugins/_codemirror.scss` full of `.cm-scroller` rules would compile,
     ship, and do nothing at all — the worst failure shape there is, because it
     reads as working CSS.

     Nor can `!important` rescue it: `lint-css.mjs` allows that in `plugins/`
     only on a property some vendor has itself locked, and CodeMirror locks
     none.

     So the interior is themed through `EditorView.theme()` in the runtime,
     whose generated class outranks the base theme by specificity inside the
     same unlayered origin. That turns out to be the better route anyway: a
     CodeMirror theme is a stylesheet, so `var(--av-…)` passes straight through
     it and the editor follows every preset, both modes and the density and
     contrast axes with no JavaScript in the render path at all. Contrast that
     with ApexCharts, which parses colours itself and has to be handed hex.

     What is left here is the box, which is ours. */
  .av-code-editor {
    --av-editor-min-height: 220px;
    display: block;
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
    /* The editor scrolls inside its own box. Without this a long document
       widens the grid track it sits in and pushes `.av-content` past the
       viewport — the automatic-minimum-size trap that `.av-grid > *` and
       `.av-table-wrap` already exist for. */
    overflow: hidden;
    min-inline-size: 0;
  }
  /* Focus is indicated on the frame rather than inside it. CodeMirror removes
     the scroller's own outline (a caret is the focus indicator it wants), and
     an editor whose border does not respond reads as inert next to every other
     control on the page. `:focus-within` is also what `no-outline-none` in
     lint-css.mjs recognises as a ring painted by an ancestor. */
  .av-code-editor:focus-within {
    border-color: var(--av-color-primary);
    box-shadow: var(--av-focus-ring);
  }
  /* The real form control. It is a visible, working textarea until the vendor
     has actually mounted — `initCodeEditor` hides it, and `AdminVora.destroy()`
     brings it back. The integration doc had it `visually-hidden` from the
     start, which submits a field nobody without JavaScript can see or edit. */
  .av-code-editor__source {
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-sm);
    tab-size: 2;
    /* Source code is left-to-right in every locale — the same reason `.av-code`
       carries it. Under `dir="rtl"` a JSON document otherwise runs off the
       inline-start edge of its own scroll container. */
    direction: ltr;
    text-align: start;
  }
  /* Sits under the editor and names the language and the current state. */
  .av-code-editor__footer {
    display: flex;
    gap: var(--av-space-3);
    align-items: center;
    justify-content: space-between;
    margin-block-start: var(--av-space-2);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-xs);
  }
  .av-code-editor__lang {
    font-family: var(--av-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .av-code-editor__status[data-av-state=invalid] {
    color: var(--av-color-danger-text);
  }
  .av-code-editor__status[data-av-state=valid] {
    color: var(--av-color-success-text);
  }
}
@layer components {
  /* A row of buttons that answers the thing above it ─────────────────────
     Five places wanted exactly this — a wrapping flex row with one gap — and
     all five wrote `.av-message-actions`, because the mail reading pane needed
     it first. That class carries the *pane's* edge padding, so every borrower
     then switched the padding off again inline: the review queue three times
     with `padding: 0`, the contact and file panels with a padding of their own.
     Four inline declarations existed only to undo one line of a component that
     had been named after the first screen to need it.

     The composition is here and owns no spacing outside itself. Where a caller
     needs the row set off from what precedes it, that is the caller's own
     rhythm and comes from the spacing utilities. */
  .av-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
  /* The far end of the row — a status the buttons do not act on, sitting
     opposite them rather than after them. `margin-inline-start: auto` is
     already logical, so it follows the writing direction without an RTL rule
     of its own. Written inline three times on the review queue before it had
     a name, which is a role rather than a value: nothing about the badge
     varies per instance, only its position in the row. */
  .av-actions__end {
    margin-inline-start: auto;
  }
}
@layer components {
  /* When it happened, beside the thing it happened to ─────────────────────
     A list row, a note card and a moderation card all want the same thing:
     the smallest readable tier, muted, and never the element that gives way
     when the row is short of space.

     It was `.av-mail-item__time`, because the mailbox needed it first, and
     three unrelated screens then borrowed the mailbox's name for their own
     timestamps — the same defect `.av-message-actions` had before it became
     `.av-actions`, and the reason `.av-section`, `.av-avatar`, `.av-promo`
     and `.av-thumb` all moved out of the page partials that first used them.
     The review queue is what surfaced it: having borrowed the class, it then
     overrode the spacing inline, which is a component being adjusted by a
     page in the one place no gate can read.

     `flex: none` is for the two callers that are flex rows; in the review
     card's identity grid it is inert, and carrying it costs nothing next to
     a second definition of the same three declarations.

     Tabular figures because a column of times is read down, not across: with
     proportional digits `11:02` and `15:48` do not line up, and a list of a
     dozen of them looks ragged for no reason a reader can name. */
  .av-timestamp {
    flex: none;
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
}
@layer components {
  /* Order book ───────────────────────────────────────────────────────────
     Resting orders either side of a spread: asks above it, bids below it.
     The two sides are a *row role*, not a colour somebody chose — which is
     why they are classes rather than the six inline `color` declarations the
     crypto dashboard had been carrying. A price row means one of exactly
     three things, and each is named.

     Colour is not the only signal, and this is worth stating because an
     auditor will ask: the asks sit above the spread row and the bids below
     it, the spread row says so in words, and the table's caption says which
     way round they are. The colour agrees with a position the reader can
     already see.

     There is deliberately no bare `.av-book` rule, and so no `.av-book` in the
     markup: the block has nothing to declare, and `check:page-classes` is
     right to reject a class that styles nothing. The `__` names say which
     component the three roles belong to, which is the job a block name would
     otherwise be doing here. */
  .av-book__ask {
    color: var(--av-color-danger-text);
  }
  .av-book__bid {
    color: var(--av-color-success-text);
  }
  /* Scoped, and the scope is load-bearing. `.av-table tbody th` sets
     `text-align: start` at a higher specificity than a bare class, so an
     unqualified `.av-book__spread` loses the alignment and the row silently
     goes back to the start edge — which is what happened here, and what the
     pixel diff caught before it shipped. The inline style it replaced won by
     being inline; a class has to earn it. Written as real specificity rather
     than by relying on `@use` order, per the house rule. */
  .av-table tbody th.av-book__spread {
    text-align: center;
    background: var(--av-surface-sunken);
  }
}
@layer components {
  /* A link that is the point of its row ──────────────────────────────────
     An order number, an invoice reference, a product name, a customer's
     name: the one thing in the row a reader is meant to click. It carries a
     little more weight than body text and restates the link colour, which is
     the half that does the work — inside a table cell or a line item the
     surrounding rule often sets its own `color`, and an `<a>` inheriting
     from `base` would quietly stop looking like a link.

     It was `.av-auth__link`, because a sign-in card needed it first, and then
     **45 of its 55 uses ended up on pages that have nothing to do with
     authentication** — orders, invoices, products, customers, a ticket and a
     dashboard. That is the same defect as `.av-mail-item__time` before it
     became `.av-timestamp`, and `.av-message-actions` before `.av-actions`,
     with an order of magnitude more call sites.

     No `font-size`: the link is whatever size the row it sits in is, which is
     why the one page that wanted it smaller had been writing `font-size` next
     to the class inline rather than reaching for a modifier. */
  .av-link {
    color: var(--av-text-link);
    font-weight: var(--av-font-weight-medium);
  }
}
@layer components {
  /* A machine-readable identifier ────────────────────────────────────────
     An SKU, an order number, a charge reference, a discount code, a patient
     or delivery id. It is set in the mono face for the reason code is: the
     characters are meant to be compared, transcribed and read back, and a
     proportional face makes `1`, `l` and `I` — and `0` and `O` — the same
     shape.

     Thirty-nine of these were written inline across ten pages, and the pass
     that collected them found the inconsistency the inline styles had been
     hiding: identifiers in a `<th scope="row">` were left at the table's own
     size, identifiers in a `<td>` or a `<dd>` were shrunk to `xs`, and two
     detail lists disagreed with each other about which. That is a real
     difference in role — a row header names the row, a cell is one value
     among several — so it is a modifier here rather than a value quietly
     chosen for all of them. Picking one size would move nine pages, which is
     a design decision and not this pass's to make. */
  .av-ident {
    font-family: var(--av-font-mono);
  }
  .av-ident--sm {
    font-size: var(--av-font-size-xs);
  }
}
@layer components {
  /* A block of written English, measured ─────────────────────────────────
     A body of prose wants a narrower column than a data table does — past
     roughly 70 characters the eye loses the start of the next line — plus the
     looser leading and the softer ink that make a paragraph read as commentary
     rather than as a value.

     This was `.av-message-body` and was reached for by the product page's
     description, which is not a message and had to switch off the mail pane's
     edge padding inline to use it. The typography is the reusable part; the
     padding belongs to the pane. */
  .av-prose {
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-relaxed);
    color: var(--av-text-secondary);
    max-inline-size: 70ch;
  }
  .av-prose p {
    margin: 0 0 var(--av-space-4);
  }
  .av-prose p:last-child {
    margin-block-end: 0;
  }
}
@layer components {
  /* Section ───────────────────────────────────────────────────────────────
     A band of one page: a heading, an optional sentence about it, then the
     content. It lived in `components/_example.scss` because the UI-kit
     reference pages needed it first — the same accident that had `.av-avatar`
     spread across the topbar, the customer card and the chat partial. It is a
     page-rhythm primitive rather than a reference-page one, and the storefront
     is the second caller that proves it.

     `scroll-margin` is not decoration — the jump links on the reference pages
     land inside `.av-content`, which scrolls under a sticky topbar, and
     without it every anchor arrives with its own heading off-screen. */
  .av-section {
    margin-block-end: var(--av-space-10);
    scroll-margin-block-start: var(--av-space-6);
    min-inline-size: 0;
  }
  .av-section:last-child {
    margin-block-end: 0;
  }
  .av-section__head {
    margin-block-end: var(--av-space-4);
  }
  /* An eyebrow above a grid — quieter than `.av-section__title`, and hugging
     the block it introduces rather than opening a band. It was 200 characters
     of inline `style=` written twice on one page, against a class that styled
     nothing at all: the purest form of the hazard the page-rhythm rule in
     `layout/_shell.scss` was written to close. */
  .av-section-title {
    margin-block: 0 var(--av-space-3);
    font-size: var(--av-font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
  }
  /* The eyebrow owns the gap to its own block, so the page rhythm must not
     open a second one — the same refusal `.av-tab-nav-bar + *` makes. */
  .av-section-title + * {
    margin-block-start: 0;
  }
  .av-section__title {
    margin: 0;
    color: var(--av-text-primary);
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-tight);
  }
  .av-section__note {
    margin: var(--av-space-1-5) 0 0;
    max-inline-size: 72ch;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-relaxed);
  }
  /* A head that carries an action becomes a row; a head without one is left
     exactly as it was. Selecting on the child rather than adding a `--row`
     modifier is what makes that true: the eleven reference pages already
     write a title and a note as siblings inside `.av-section__head`, and a
     blanket `display: flex` would lay those two side by side on every one of
     them. Markup with no action never meets this rule at all. */
  .av-section__head:has(.av-section__action) {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-3);
    flex-wrap: wrap;
  }
  /* "See all" is a link and is dressed as one. It was a ghost button on the
     storefront, which is a control wearing the wrong affordance: a ghost
     button reads as an action on the section — collapse it, refresh it — and
     this one leaves the page. */
  .av-section__action {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-2);
    color: var(--av-color-primary-text);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    text-decoration: none;
    white-space: nowrap;
  }
  .av-section__action:hover {
    text-decoration: underline;
  }
  .av-section__action:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
    border-radius: var(--av-radius-xs);
  }
  /* The chevron is drawn rather than written. `›` is a character — U+203A,
     announced as a quotation mark by a screen reader — and an inline SVG
     would put six copies of one glyph in the markup of a page that already
     repeats a card twenty times.

     Two physical borders make the corner, and `rotate` has no logical form,
     so the direction is carried as a custom property the `[dir]` rule flips:
     the flip is the mirror of the angle, not an arbitrary second value: the
     two borders are logical, so under `dir="rtl"` they already draw the
     mirrored corner, and mirroring a shape rotated by θ is the same shape
     rotated by −θ. The nudge is flipped for the same reason. */
  .av-section__action::after {
    content: "";
    inline-size: var(--av-space-1-5);
    block-size: var(--av-space-1-5);
    border-block-start: 2px solid currentColor;
    border-inline-end: 2px solid currentColor;
    rotate: var(--av-chevron-turn, 45deg);
    transition: translate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-section__action:hover::after {
    translate: var(--av-chevron-nudge, 3px) 0;
  }
  [dir=rtl] .av-section__action {
    --av-chevron-turn: -45deg;
    --av-chevron-nudge: -3px;
  }
  /* The storefront rhythm. Four tight bands read as a catalogue; two loose
     ones read as an unfinished page, and the difference is entirely in the
     space between a heading and the thing it names. */
  .av-section--tight {
    margin-block-end: var(--av-space-6);
  }
  .av-section--tight .av-section__head {
    margin-block-end: var(--av-space-3);
  }
}
@layer components {
  /* `.av-section` lives in `components/_section.scss`: the reference pages
     needed it first, the storefront was the second caller, and a page-rhythm
     primitive named after the page that happened to want it is how a class
     ends up defined in three partials. */
  /* Jump links ────────────────────────────────────────────────────────────
     A wrapping row of chips rather than a fixed side rail. A rail is the
     prettier pattern and the wrong one here: it needs a second grid track that
     every page then has to reserve, and it is one more thing to unwind at
     320px and under `dir="rtl"`. Chips wrap, and that is the whole story. */
  .av-jump {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    margin-block-end: var(--av-space-6);
    padding: 0;
    list-style: none;
  }
  .av-jump__link {
    display: inline-flex;
    align-items: center;
    padding: var(--av-space-1-5) var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    text-decoration: none;
    transition: color var(--av-duration-fast) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-jump__link:hover {
    border-color: var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  /* The section in view, set by [data-av-scrollspy]. */
  .av-jump__link[aria-current=true] {
    border-color: var(--av-color-primary-border);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  /* Sticky: the jump bar stays in view while the page scrolls, so the
     scrollspy highlight is visible. One scrolling row instead of wrapping, so it
     never takes two rows of the viewport. */
  .av-jump--sticky {
    position: sticky;
    inset-block-start: var(--av-space-2);
    z-index: var(--av-z-sticky);
    flex-wrap: nowrap;
    inline-size: fit-content;
    max-inline-size: 100%;
    padding: var(--av-space-1-5);
    overflow-x: auto;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    box-shadow: var(--av-shadow-md);
    scrollbar-width: none;
  }
  .av-jump--sticky .av-jump__link {
    flex-shrink: 0;
    border-color: transparent;
    background: transparent;
  }
  .av-jump--sticky .av-jump__link[aria-current=true] {
    border-color: var(--av-color-primary-border);
    background: var(--av-color-primary-subtle);
  }
  /* Example ───────────────────────────────────────────────────────────────
     The demo and its source, from one copy of the markup — see the `{{< … }}`
     construct in tools/build-html.mjs. The panel is collapsed by default so a
     page of thirty examples stays scannable; the reader opens the one they are
     about to paste. */
  .av-example {
    margin-block-end: var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
    min-inline-size: 0;
    /* The card is rounded and its last child is not. `.av-example__preview`
       paints `--av-surface-base`, a different colour from the card's own
       surface, with square corners — so it filled the bottom two corners and
       the border appeared to stop short of meeting itself. Clipping to the
       card's own radius fixes every child at once, including any added later.

       The obvious alternative does not work: `.av-example__preview:last-child`
       never matches, because the code panel is always present in the DOM and
       merely `hidden`, so `:last-child` is the code element even when the
       panel is closed. A `:has(> [hidden])` variant does work but lands at the
       0-3-0 specificity ceiling and depends on nothing else ever being hidden
       inside the card.

       Clipping is safe here in a way it would not have been a month ago:
       dropdowns opened inside a preview are promoted to the top layer, so they
       escape `overflow` entirely, and the preview owns its own horizontal
       scrolling. The cost is that a hover shadow on a card sitting flush
       against the preview's edge is clipped — the preview's padding absorbs
       most of it. */
    overflow: hidden;
  }
  .av-example:last-child {
    margin-block-end: 0;
  }
  .av-example__head {
    display: flex;
    align-items: flex-start;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-example__meta {
    min-inline-size: 0;
  }
  .av-example__title {
    margin: 0;
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-example__note {
    margin: var(--av-space-1) 0 0;
    max-inline-size: 68ch;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    line-height: var(--av-line-height-normal);
  }
  /* `margin-inline-start: auto` rather than `justify-content: space-between`,
     so the tools stay at the trailing edge even when the example has no title
     and the meta block is absent entirely. */
  .av-example__tools {
    display: flex;
    flex: none;
    gap: var(--av-space-1);
    margin-inline-start: auto;
  }
  .av-example__tool {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    padding: var(--av-space-1) var(--av-space-2);
    border: 1px solid transparent;
    border-radius: var(--av-radius-sm);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    white-space: nowrap;
    transition: color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-example__tool:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-example__tool[aria-expanded=true] {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-example__tool.is-done {
    color: var(--av-color-success-text);
  }
  /* The preview sits on the page ground rather than the card surface, so a
     raised component inside it still reads as raised. Its own scrollbar keeps
     a wide table from widening the grid track — the automatic minimum size of
     a grid item is its content, and `.av-content` would absorb the overflow
     while the page is visibly broken. */
  .av-example__preview {
    padding: var(--av-space-5) var(--av-space-4);
    background: var(--av-surface-base);
    overflow-x: auto;
    min-inline-size: 0;
  }
  .av-example__preview--row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-3);
    align-items: center;
  }
  .av-example__preview--stack {
    display: grid;
    gap: var(--av-space-4);
    justify-items: stretch;
  }
  .av-example__preview > * {
    min-inline-size: 0;
  }
  /* Kit tile ──────────────────────────────────────────────────────────────
     The overview page's index of the library. It is an `<a>` rather than a card
     containing one, so the whole tile is the target and there is a single tab
     stop per entry — a card with a link in its title gives you a large clickable
     area that the keyboard cannot reach. */
  .av-kit-tile {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-2);
    padding: var(--av-space-5);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
    color: inherit;
    text-decoration: none;
    transition: translate var(--av-duration-normal) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-kit-tile:hover {
    translate: 0 var(--av-lift);
    border-color: var(--av-color-primary-border);
    box-shadow: var(--av-shadow-md);
  }
  .av-kit-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 38px;
    block-size: 38px;
    margin-block-end: var(--av-space-1);
    border-radius: var(--av-radius-md);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-kit-tile__title {
    margin: 0;
    color: var(--av-text-primary);
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-kit-tile__text {
    margin: 0;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-normal);
  }
  .av-kit-tile__meta {
    margin-block-start: auto;
    padding-block-start: var(--av-space-3);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-xs);
  }
  /* Token specimens ───────────────────────────────────────────────────────
     The foundations page shows a token by *being* it — a swatch painted with
     the colour, a box carrying the radius, a bar spaced by the step. Reading
     the value off a table is not the same as seeing the ramp, and a specimen
     that draws itself cannot fall out of date. */
  .av-specimen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: var(--av-space-3);
    inline-size: 100%;
  }
  .av-specimen__item {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1);
    min-inline-size: 0;
  }
  .av-specimen__chip {
    /* A specimen demonstrates one token, and *which* token is per-instance data,
       so it arrives as a value custom property rather than a declaration. Each
       of the 42 chips named a different token, which is the definition of
       data. Sixteen have since left: the preset picker's tiles all carried
       one identical gradient, and a value that recurs is design. */
    display: block;
    block-size: 46px;
    border: 1px solid var(--av-specimen-border, var(--av-border-subtle));
    border-radius: var(--av-specimen-radius, var(--av-radius-md));
    background: var(--av-specimen-bg, transparent);
    box-shadow: var(--av-specimen-shadow, none);
  }
  /* A specimen that is also a control — the preset picker. Type selector rather
     than a modifier class: the difference is the element, and a `<button>` is
     the only thing that needs its UA chrome taken off. */
  /* The preset picker's chip. Sixteen of them, and all sixteen carried the
     identical gradient inline - the same declaration written out sixteen
     times, which is a modifier in disguise rather than per-instance data.
     What differs between the tiles is `data-av-preset`, which redefines the
     ramp the gradient reads; the gradient itself is one rule. */
  button.av-specimen__item .av-specimen__chip {
    --av-specimen-bg: linear-gradient(
      135deg,
      var(--av-primary-400),
      var(--av-primary-600) 55%,
      var(--av-accent-500)
    );
  }
  button.av-specimen__item {
    padding: 0;
    border: 0;
    background: none;
    text-align: start;
  }
  .av-specimen__name {
    color: var(--av-text-primary);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-2xs);
    overflow-wrap: anywhere;
  }
  .av-specimen__value {
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
  }
  /* A spacing step drawn to scale. The bar's inline size *is* the token, so the
     row is a ruler rather than a caption. */
  .av-ruler {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: var(--av-space-2) var(--av-space-4);
    align-items: center;
    inline-size: 100%;
  }
  .av-ruler__name {
    color: var(--av-text-secondary);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-2xs);
  }
  .av-ruler__bar {
    block-size: 14px;
    border-radius: var(--av-radius-xs);
    background: var(--av-color-primary);
  }
  /* Icon grid ─────────────────────────────────────────────────────────────
     Each cell is a button so the name can be copied with one click, which is
     the only thing anyone ever wants from an icon index. */
  .av-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: var(--av-space-2);
    inline-size: 100%;
  }
  .av-icon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-2);
    border: 1px solid transparent;
    border-radius: var(--av-radius-md);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-2xs);
    text-align: center;
    overflow-wrap: anywhere;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-icon-cell:hover {
    border-color: var(--av-border-default);
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-icon-cell .av-icon {
    inline-size: 22px;
    block-size: 22px;
  }
  .av-icon-cell.is-done {
    border-color: var(--av-color-success-border);
    color: var(--av-color-success-text);
  }
  /* Flush inside the example rather than a floating box of its own. Written at
     0-2-0 on purpose: `.av-code` is 0-1-0 in the same layer, so at equal
     specificity the winner would be whichever partial `@use` happened to load
     last — the failure this codebase has already shipped twice. */
  .av-example .av-example__code {
    border: 0;
    border-block-start: 1px solid var(--av-border-subtle);
    border-radius: 0;
    border-end-start-radius: calc(var(--av-radius-lg) - 1px);
    border-end-end-radius: calc(var(--av-radius-lg) - 1px);
  }
}
@layer components {
  /* Animated icons ──────────────────────────────────────────────────────
     Pure CSS over inline SVG — no Lottie, no runtime, no vendor payload. The
     free tiers of the animated-icon libraries (Lordicon and the Lottie hosts)
     forbid redistribution inside a template, which is exactly what this repo
     ships, so the set is ours.

     The classes are named for the MOTION, not for the icon: a bell and a
     pendulum both swing, a spinner and a gear both spin. Icons compose these
     primitives, which is why 30-odd icons need roughly a dozen keyframes and
     why a new icon usually needs no new CSS at all.

     Every animated part is addressed WITHOUT its icon modifier in the selector
     — `.av-aicon-tile:hover .av-aicon__spin`, not `… .av-aicon--gear .av-…`.
     That keeps every trigger rule at exactly 0-3-0, the specificity ceiling in
     docs/11-workflow/01-coding-standards.md. */
  .av-aicon {
    display: inline-grid;
    place-items: center;
    color: var(--av-color-primary-text);
  }
  .av-aicon .av-icon {
    inline-size: var(--av-aicon-size, 28px);
    block-size: var(--av-aicon-size, 28px);
  }
  /* fill-box makes a transform inside an SVG rotate about the shape's own box
     rather than the viewport origin, which is the single thing that most often
     makes hand-written SVG animation fly off screen. */
  .av-aicon [class*=av-aicon__] {
    transform-box: fill-box;
    transform-origin: center;
  }
  /* Spin is rotation about the *icon's* axis, not the shape's own. A spinner
     arc covers a quarter of the circle, so its fill-box centre sits up in the
     top-right — rotating about that sends the arc orbiting around the outside
     of the icon instead of turning on the spot, which is what the loading tile
     was doing. `view-box` puts the origin at the centre of the 24×24 viewBox,
     where a gear, a refresh arrow and a spinner arc all actually turn.

     Only the spin primitives. Every other one — swing, wiggle, pop, lift —
     acts on the shape itself and genuinely wants its own box.

     Written at 0-2-0 because the blanket `transform-box: fill-box` rule above
     is `.av-aicon [class*='av-aicon__']`, which is also 0-2-0; a bare
     `.av-aicon__spin` would lose to it however far down the file it sat. */
  .av-aicon .av-aicon__spin,
  .av-aicon .av-aicon__spin-fast {
    transform-box: view-box;
  }
  /* ── Motion primitives ──────────────────────────────────────────────── */
  .av-aicon-tile:hover .av-aicon__spin,
  .av-aicon-tile:focus-visible .av-aicon__spin,
  .av-aicon-tile.is-playing .av-aicon__spin {
    animation: av-ai-spin 1.4s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__spin-fast,
  .av-aicon-tile:focus-visible .av-aicon__spin-fast,
  .av-aicon-tile.is-playing .av-aicon__spin-fast {
    animation: av-ai-spin 0.8s linear infinite;
  }
  .av-aicon-tile:hover .av-aicon__swing,
  .av-aicon-tile:focus-visible .av-aicon__swing,
  .av-aicon-tile.is-playing .av-aicon__swing {
    animation: av-ai-swing 0.9s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__beat,
  .av-aicon-tile:focus-visible .av-aicon__beat,
  .av-aicon-tile.is-playing .av-aicon__beat {
    animation: av-ai-beat 1s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__pop,
  .av-aicon-tile:focus-visible .av-aicon__pop,
  .av-aicon-tile.is-playing .av-aicon__pop {
    animation: av-ai-pop 0.7s var(--av-ease-spring) infinite;
  }
  .av-aicon-tile:hover .av-aicon__bob-down,
  .av-aicon-tile:focus-visible .av-aicon__bob-down,
  .av-aicon-tile.is-playing .av-aicon__bob-down {
    animation: av-ai-bob-down 1.1s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__bob-up,
  .av-aicon-tile:focus-visible .av-aicon__bob-up,
  .av-aicon-tile.is-playing .av-aicon__bob-up {
    animation: av-ai-bob-up 1.1s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__shake,
  .av-aicon-tile:focus-visible .av-aicon__shake,
  .av-aicon-tile.is-playing .av-aicon__shake {
    animation: av-ai-shake 0.8s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__lift,
  .av-aicon-tile:focus-visible .av-aicon__lift,
  .av-aicon-tile.is-playing .av-aicon__lift {
    animation: av-ai-lift 1.2s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__blink,
  .av-aicon-tile:focus-visible .av-aicon__blink,
  .av-aicon-tile.is-playing .av-aicon__blink {
    animation: av-ai-blink 2s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__flap,
  .av-aicon-tile:focus-visible .av-aicon__flap,
  .av-aicon-tile.is-playing .av-aicon__flap {
    animation: av-ai-flap 1.6s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__slide,
  .av-aicon-tile:focus-visible .av-aicon__slide,
  .av-aicon-tile.is-playing .av-aicon__slide {
    animation: av-ai-slide 1.1s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__flip,
  .av-aicon-tile:focus-visible .av-aicon__flip,
  .av-aicon-tile.is-playing .av-aicon__flip {
    animation: av-ai-flip 1.4s var(--av-ease-spring) infinite;
  }
  .av-aicon-tile:hover .av-aicon__wiggle,
  .av-aicon-tile:focus-visible .av-aicon__wiggle,
  .av-aicon-tile.is-playing .av-aicon__wiggle {
    animation: av-ai-wiggle 1.2s var(--av-ease-standard) infinite;
  }
  .av-aicon-tile:hover .av-aicon__fade,
  .av-aicon-tile:focus-visible .av-aicon__fade,
  .av-aicon-tile.is-playing .av-aicon__fade {
    animation: av-ai-fade 1.4s var(--av-ease-standard) infinite;
  }
  /* Draw-on. Every drawn path carries pathLength="100" in the markup, so one
     dasharray works for a tick, a chart line and a signature alike regardless
     of their real geometry. */
  .av-aicon__draw {
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
  }
  .av-aicon-tile:hover .av-aicon__draw,
  .av-aicon-tile:focus-visible .av-aicon__draw,
  .av-aicon-tile.is-playing .av-aicon__draw {
    animation: av-ai-draw 1.6s var(--av-ease-standard) infinite;
  }
  /* Staggered dots — one keyframe, three delays. */
  .av-aicon-tile:hover [class*=av-aicon__dot-],
  .av-aicon-tile:focus-visible [class*=av-aicon__dot-],
  .av-aicon-tile.is-playing [class*=av-aicon__dot-] {
    animation: av-ai-dot 1.2s var(--av-ease-standard) infinite;
  }
  .av-aicon__dot-2 {
    animation-delay: 0.15s;
  }
  .av-aicon__dot-3 {
    animation-delay: 0.3s;
  }
  /* ── Per-icon pivots ────────────────────────────────────────────────
     Only the origin differs, and an origin is not motion, so these stay off
     the hover selectors and out of the specificity budget. */
  .av-aicon--bell .av-aicon__swing {
    transform-origin: top center;
  }
  .av-aicon--trash .av-aicon__lift {
    transform-origin: bottom right;
  }
  .av-aicon--mail .av-aicon__flap {
    transform-origin: top center;
  }
  .av-aicon--lock .av-aicon__bob-up {
    transform-origin: bottom center;
  }
  .av-aicon--pin .av-aicon__swing {
    transform-origin: top center;
  }
  /* ── Keyframes ──────────────────────────────────────────────────────── */
  @keyframes av-ai-spin {
    to {
      rotate: 360deg;
    }
  }
  @keyframes av-ai-swing {
    0%, 100% {
      rotate: 0deg;
    }
    20% {
      rotate: 14deg;
    }
    40% {
      rotate: -10deg;
    }
    60% {
      rotate: 6deg;
    }
    80% {
      rotate: -3deg;
    }
  }
  @keyframes av-ai-beat {
    0%, 100% {
      scale: 1;
    }
    18% {
      scale: 1.22;
    }
    32% {
      scale: 1;
    }
    50% {
      scale: 1.14;
    }
  }
  @keyframes av-ai-pop {
    0%, 100% {
      scale: 1;
      rotate: 0deg;
    }
    45% {
      scale: 1.25;
      rotate: 12deg;
    }
  }
  @keyframes av-ai-bob-down {
    0%, 100% {
      translate: 0 0;
      opacity: 1;
    }
    45% {
      translate: 0 3px;
      opacity: 0.55;
    }
  }
  @keyframes av-ai-bob-up {
    0%, 100% {
      translate: 0 0;
    }
    45% {
      translate: 0 -3px;
    }
  }
  @keyframes av-ai-shake {
    0%, 100% {
      translate: 0 0;
    }
    15%, 45%, 75% {
      translate: -1.5px 0;
    }
    30%, 60%, 90% {
      translate: 1.5px 0;
    }
  }
  @keyframes av-ai-lift {
    0%, 100% {
      translate: 0 0;
      rotate: 0deg;
    }
    35%, 65% {
      translate: 0 -2px;
      rotate: -18deg;
    }
  }
  @keyframes av-ai-blink {
    0%, 88%, 100% {
      scale: 1 1;
    }
    94% {
      scale: 1 0.06;
    }
  }
  /* A real flap would rotate about X, but SVG children do not render 3D
     transforms dependably across engines. Negating scaleY about the hinge
     reads as the same motion and works everywhere. */
  @keyframes av-ai-flap {
    0%, 100% {
      scale: 1 1;
    }
    40%, 60% {
      scale: 1 -1;
    }
  }
  @keyframes av-ai-slide {
    0%, 100% {
      translate: 0 0;
      opacity: 1;
    }
    45% {
      translate: 3px 0;
      opacity: 0.5;
    }
  }
  @keyframes av-ai-flip {
    0%, 100% {
      rotate: 0deg;
    }
    50% {
      rotate: 90deg;
    }
  }
  @keyframes av-ai-wiggle {
    0%, 100% {
      rotate: 0deg;
      translate: 0 0;
    }
    25% {
      rotate: -8deg;
      translate: -1px 0;
    }
    75% {
      rotate: 8deg;
      translate: 1px 0;
    }
  }
  @keyframes av-ai-fade {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.25;
    }
  }
  @keyframes av-ai-draw {
    0% {
      stroke-dashoffset: 100;
    }
    55%, 100% {
      stroke-dashoffset: 0;
    }
  }
  @keyframes av-ai-dot {
    0%, 100% {
      translate: 0 0;
      opacity: 0.45;
    }
    35% {
      translate: 0 -2.5px;
      opacity: 1;
    }
  }
  /* ── Gallery tile ───────────────────────────────────────────────────── */
  .av-aicon-tile {
    display: grid;
    justify-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-5) var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
    color: var(--av-text-muted);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--av-duration-normal) var(--av-ease-standard), box-shadow var(--av-duration-normal) var(--av-ease-standard), translate var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-aicon-tile:hover {
    translate: 0 var(--av-lift);
    border-color: color-mix(in oklab, var(--av-color-primary) 30%, var(--av-border-subtle));
    box-shadow: var(--av-shadow-md);
  }
  .av-aicon-tile__art {
    display: grid;
    place-items: center;
    inline-size: 56px;
    block-size: 56px;
    border-radius: var(--av-radius-lg);
    background: var(--av-color-primary-subtle);
    transition: box-shadow var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-aicon-tile:hover .av-aicon-tile__art {
    box-shadow: var(--av-glow-primary);
  }
  .av-aicon-tile__label {
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-secondary);
  }
  .av-aicon-tile__motion {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
    font-family: var(--av-font-mono);
  }
  .av-aicon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: var(--av-space-4);
  }
  .av-aicon-grid > * {
    min-inline-size: 0;
  }
  /* Size demo row */
  .av-aicon--xl {
    --av-aicon-size: 44px;
  }
  .av-aicon--lg {
    --av-aicon-size: 34px;
  }
  .av-aicon--md {
    --av-aicon-size: 26px;
  }
  .av-aicon--sm {
    --av-aicon-size: 20px;
  }
  /* Role colours, so an animated icon can carry status like any other. */
  .av-aicon--success {
    color: var(--av-color-success-text);
  }
  .av-aicon--warning {
    color: var(--av-color-warning-text);
  }
  .av-aicon--danger {
    color: var(--av-color-danger-text);
  }
  .av-aicon--info {
    color: var(--av-color-info-text);
  }
  /* An icon that never stops, for spinners and live indicators. Written as its
     own trigger rather than as .is-playing so it survives a rebuild of the tile. */
  .av-aicon--loop .av-aicon__spin,
  .av-aicon--loop .av-aicon__spin-fast {
    animation: av-ai-spin 1s linear infinite;
  }
  /* The global rule in base/_base.scss already collapses animation-duration
     under prefers-reduced-motion. This makes the intent explicit for the one
     component whose entire purpose is movement: it becomes a static icon set. */
  @media (prefers-reduced-motion: reduce) {
    .av-aicon [class*=av-aicon__] {
      animation: none;
    }
    .av-aicon__draw {
      stroke-dashoffset: 0;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-aicon [class*=av-aicon__] {
    animation: none;
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-aicon__draw {
    stroke-dashoffset: 0;
  }
}
@layer components {
  /* Tooltip, portalled to <body> so no ancestor can clip it ──────────── */
  .av-tooltip {
    position: fixed;
    z-index: var(--av-z-tooltip);
    max-inline-size: 240px;
    padding: var(--av-space-1-5) var(--av-space-2-5);
    border-radius: var(--av-radius-sm);
    background: var(--av-surface-inverse);
    color: var(--av-text-inverse);
    font-size: var(--av-font-size-xs);
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    translate: 0 4px;
    transition: opacity var(--av-duration-fast) var(--av-ease-standard), translate var(--av-duration-fast) var(--av-ease-standard);
  }
  /* No `pointer-events: none`: the bubble is hoverable (WCAG 1.4.13), so the
     pointer can travel onto it to read it without it closing. */
  .av-tooltip.is-visible {
    opacity: 1;
    translate: 0 0;
  }
  /* Flipped below its control when there is no room above, so it rises
     towards the control rather than away from it. */
  .av-tooltip--below {
    translate: 0 -4px;
  }
  /* `aria-keyshortcuts` on the control, drawn as keys after the label. */
  .av-tooltip__keys {
    display: inline-flex;
    gap: var(--av-space-1);
    margin-inline-start: var(--av-space-1-5);
    vertical-align: baseline;
  }
  .av-tooltip__kbd {
    padding: 0 var(--av-space-1);
    border: 1px solid color-mix(in oklch, currentColor 40%, transparent);
    border-radius: var(--av-radius-xs);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-2xs);
  }
  @media (prefers-reduced-motion: reduce) {
    .av-tooltip, .av-tooltip--below {
      translate: 0 0;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-tooltip, :is([data-av-motion=reduced], [data-av-motion=off]) .av-tooltip--below {
    translate: 0 0;
  }
}
@layer components {
  /* Skeleton ────────────────────────────────────────────────────────── */
  .av-skeleton {
    --size: 100%;
    inline-size: var(--size);
    block-size: 12px;
    border-radius: var(--av-radius-sm);
    background: linear-gradient(90deg, var(--av-surface-sunken) 0%, color-mix(in oklch, var(--av-surface-sunken) 55%, var(--av-surface-raised)) 50%, var(--av-surface-sunken) 100%);
    background-size: 200% 100%;
    animation: av-shimmer 1.4s linear infinite;
  }
  .av-skeleton--circle {
    inline-size: var(--size);
    block-size: var(--size);
    border-radius: var(--av-radius-full);
    flex: none;
  }
  @keyframes av-shimmer {
    to {
      background-position: -200% 0;
    }
  }
}
@layer components {
  /* Empty state ─────────────────────────────────────────────────────── */
  .av-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--av-space-10) var(--av-space-6);
  }
  /* An author `display` beats the UA [hidden] rule at equal specificity. */
  .av-empty[hidden] {
    display: none;
  }
  .av-empty__icon {
    display: grid;
    place-items: center;
    inline-size: 56px;
    block-size: 56px;
    margin-block-end: var(--av-space-4);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
  }
  .av-empty__title {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    margin: 0 0 var(--av-space-1);
  }
  .av-empty__text {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    max-inline-size: 42ch;
    margin: 0 0 var(--av-space-4);
  }
}
@layer components {
  /* Tabs ────────────────────────────────────────────────────────────── */
  .av-tabs {
    display: flex;
    gap: var(--av-space-1);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-tabs__tab {
    position: relative;
    padding: var(--av-space-3) var(--av-space-4);
    border: 0;
    background: none;
    color: var(--av-text-muted);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    transition: color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-tabs__tab::after {
    content: "";
    position: absolute;
    inset-inline: var(--av-space-2);
    inset-block-end: -1px;
    block-size: 2px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    scale: 0 1;
    transition: scale var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-tabs__tab:hover {
    color: var(--av-text-primary);
  }
  .av-tabs__tab[aria-selected=true] {
    color: var(--av-color-primary-text);
  }
  .av-tabs__tab[aria-selected=true]::after {
    scale: 1 1;
  }
  /* Line is the default, so `--line` is an alias that exists to be written.
     A page that says nothing gets the same thing, but a page that means "line
     rather than pill" can say so, and stops reading as an oversight. */
  .av-tabs--line { /* the default */ }
  /* Pill and enclosed both replace the underline with a filled shape, so the
     ::after marker has to go — left in place it draws a second indicator
     underneath the fill, which is visible against the tab strip's border. */
  .av-tabs--pill,
  .av-tabs--enclosed {
    border-block-end: 0;
  }
  .av-tabs--pill .av-tabs__tab::after,
  .av-tabs--enclosed .av-tabs__tab::after {
    content: none;
  }
  .av-tabs--pill {
    gap: var(--av-space-2);
  }
  .av-tabs--pill .av-tabs__tab {
    border-radius: var(--av-radius-full);
    padding-block: var(--av-space-2);
    transition: color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-tabs--pill .av-tabs__tab:hover {
    background: var(--av-surface-sunken);
  }
  .av-tabs--pill .av-tabs__tab[aria-selected=true] {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  /* Enclosed tabs sit *on* the panel: the selected tab's lower border is
     removed so the tab and the content below read as one surface. That needs
     the strip's own border back as a separate line, drawn on the strip rather
     than the tabs, or the gap between tabs has no rule under it. */
  .av-tabs--enclosed {
    gap: 0;
    box-shadow: inset 0 -1px 0 0 var(--av-border-subtle);
  }
  .av-tabs--enclosed .av-tabs__tab {
    border: 1px solid transparent;
    border-start-start-radius: var(--av-radius-md);
    border-start-end-radius: var(--av-radius-md);
  }
  .av-tabs--enclosed .av-tabs__tab[aria-selected=true] {
    border-color: var(--av-border-subtle);
    border-block-end-color: var(--av-surface-raised);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
  }
  /* Vertical tabs run down the inline start, so the marker moves to that edge
     and the strip's rule becomes a border rather than an underline. The
     `::after` is repositioned rather than replaced, so the same scale
     transition still plays — only its axis changes. */
  .av-tabs--vertical {
    flex-direction: column;
    gap: var(--av-space-1);
    border-block-end: 0;
    border-inline-end: 1px solid var(--av-border-subtle);
  }
  .av-tabs--vertical .av-tabs__tab {
    text-align: start;
  }
  .av-tabs--vertical .av-tabs__tab::after {
    inset-inline: auto -1px;
    inset-block: var(--av-space-2);
    inline-size: 2px;
    block-size: auto;
    scale: 1 0;
  }
  .av-tabs--vertical .av-tabs__tab[aria-selected=true]::after {
    scale: 1 1;
  }
}
@layer components {
  /* Disclosure ────────────────────────────────────────────────────────────
     `data-av-collapse` toggles `aria-expanded` on the button and writes
     `data-av-state` on the panel. Until now nothing gave that state a default
     appearance: the checkout summary supplied its own rule inside a media query,
     because there the panel must stay open on desktop no matter what the
     attribute says. So the behaviour worked everywhere and the *component*
     existed on exactly one screen.

     This is the default contract. A panel that opts out — one like checkout's,
     whose visibility depends on the viewport — simply keeps its own rule at a
     specificity that wins, which is what the media-query rule already does.

     Note the panel is hidden by `display`, not by the `hidden` attribute. The
     attribute is the stronger tool and the wrong one here: `hidden` set by the
     author would beat the media query that has to force the panel back open at
     desktop width, and the layout would then need `!important` to recover. */
  .av-disclosure__panel[data-av-state=collapsed] {
    display: none;
  }
  /* The chevron belongs to the button, so it reads the button's own state
     rather than needing a class toggled alongside it. One source of truth, and
     it is the attribute assistive technology is already reading. */
  .av-disclosure__caret {
    transition: rotate var(--av-duration-normal) var(--av-ease-standard);
  }
  [aria-expanded=true] > .av-disclosure__caret {
    rotate: 180deg;
  }
}
@layer components {
  /* Command palette ─────────────────────────────────────────────────── */
  .av-palette {
    inline-size: min(620px, 100vw - var(--av-space-8));
    max-block-size: min(60dvh, 520px);
    margin: auto;
    margin-block-start: 12vh; /* sits high, like every palette users know */
    padding: 0;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-overlay);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-2xl);
    overflow: hidden;
  }
  .av-palette::backdrop {
    background: var(--av-overlay);
    backdrop-filter: blur(3px);
  }
  .av-palette[open] {
    animation: av-dialog-in var(--av-duration-normal) var(--av-ease-emphasized);
  }
  .av-palette[open]::backdrop {
    animation: av-fade-in var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-palette.is-closing {
    animation: av-dialog-out var(--av-duration-fast) var(--av-ease-accelerate) forwards;
  }
  .av-palette__inner {
    display: flex;
    flex-direction: column;
    max-block-size: inherit;
  }
  .av-palette__search {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-4) var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
    color: var(--av-text-muted);
  }
  .av-palette__input {
    flex: 1;
    min-inline-size: 0;
    border: 0;
    background: none;
    color: var(--av-text-primary);
    font-size: var(--av-font-size-base);
  }
  /* The input drops its own ring and the search row carries it, the same pattern
     as `.av-toolbar__search`. It is not decoration here: DOM focus never leaves
     this input — selection travels by `aria-activedescendant` — so without it
     the dialog opened with no visible indication of where typing goes. */
  .av-palette__input:focus {
    outline: none;
  }
  .av-palette__search:focus-within {
    border-block-end-color: var(--av-color-primary);
  }
  .av-palette__input::placeholder {
    color: var(--av-text-muted);
  }
  .av-palette__results {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: var(--av-space-2);
    scrollbar-width: thin;
  }
  .av-palette__group {
    padding: var(--av-space-3) var(--av-space-3) var(--av-space-1);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wider);
    text-transform: uppercase;
    color: var(--av-text-muted);
  }
  .av-palette__item {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-2-5) var(--av-space-3);
    border-radius: var(--av-radius-md);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    cursor: pointer;
  }
  .av-palette__item[aria-selected=true] {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-palette__item[aria-selected=true] .av-palette__hint {
    color: inherit;
    opacity: 0.8;
  }
  .av-palette__label {
    flex: 1;
    min-inline-size: 0;
  }
  .av-palette__hint {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-palette__empty {
    padding: var(--av-space-8) var(--av-space-5);
    text-align: center;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  .av-palette__footer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-4);
    padding: var(--av-space-3) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-palette__footer span {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
  }
}
@layer components {
  /* ══ CUSTOMIZER ═════════════════════════════════════════════════════ */
  .av-customizer-trigger {
    position: fixed;
    inset-block-start: 50%;
    inset-inline-end: 0;
    translate: 0 -50%;
    z-index: calc(var(--av-z-drawer) - 1);
    display: grid;
    place-items: center;
    /* 24px wide, the content gutter's width, so at rest it sits in the margin
       and never covers a card's last column; it widens on hover and focus.
       24px is also the WCAG 2.5.8 minimum target. */
    inline-size: 24px;
    block-size: 48px;
    border: 0;
    overflow: hidden;
    border-start-start-radius: var(--av-radius-lg);
    border-end-start-radius: var(--av-radius-lg);
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
    box-shadow: var(--av-shadow-lg);
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), inline-size var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-customizer-trigger:hover {
    background: var(--av-color-primary-hover);
  }
  .av-customizer-trigger:hover,
  .av-customizer-trigger:focus-visible {
    inline-size: 46px;
  }
  /* Mid-edge placement crosses form controls on narrow screens — corner it instead. */
  @media (max-width: 575.98px) {
    .av-customizer-trigger {
      inset-block-start: auto;
      inset-block-end: var(--av-space-4);
      inset-inline-end: var(--av-space-4);
      translate: none;
      inline-size: 46px;
      block-size: 46px;
      border-radius: var(--av-radius-full);
    }
  }
  .av-customizer-trigger .av-icon {
    animation: av-spin 6s linear infinite;
  }
  @keyframes av-spin {
    to {
      transform: rotate(1turn);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .av-customizer-trigger .av-icon {
      animation: none;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-customizer-trigger .av-icon {
    animation: none;
  }
  .av-customizer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: var(--av-z-drawer);
    inline-size: min(340px, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--av-surface-overlay);
    border-inline-start: 1px solid var(--av-border-subtle);
    box-shadow: var(--av-shadow-xl);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--av-duration-slow) var(--av-ease-emphasized), visibility 0s linear var(--av-duration-slow);
  }
  .av-customizer[hidden] {
    display: none;
  }
  [dir=rtl] .av-customizer {
    transform: translateX(-100%);
  }
  .av-customizer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }
  /* The panel sizes its own controls — the footer buttons already do this two
     rules down, and the close button had been doing it inline instead. */
  .av-customizer__header .av-btn--icon {
    --av-btn-height: 34px;
  }
  .av-customizer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--av-space-4) var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-customizer__title {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-customizer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--av-space-5);
  }
  .av-customizer__footer {
    display: flex;
    gap: var(--av-space-3);
    padding: var(--av-space-4) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-customizer__footer .av-btn {
    flex: 1;
    --av-btn-height: var(--av-control-md);
  }
  .av-customizer__group + .av-customizer__group {
    margin-block-start: var(--av-space-6);
    padding-block-start: var(--av-space-6);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-customizer__legend {
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wider);
    color: var(--av-text-muted);
    margin-block-end: var(--av-space-3);
  }
  .av-customizer__hint {
    margin: 0 0 var(--av-space-3);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* Style swatches: each is a miniature drawn in that style, so the choice is
     seen, not read. They paint from the page's current colours on purpose: a
     style is construction, and the swatch shows the construction. */
  .av-style-swatch {
    display: grid;
    place-items: center;
    inline-size: 100%;
    block-size: 34px;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-sm);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-style-swatch--auto {
    background: linear-gradient(135deg, var(--av-surface-raised) 50%, var(--av-color-primary-subtle) 50%);
  }
  .av-style-swatch--clean {
    box-shadow: 0 0 0 1px oklch(var(--av-shadow-color)/0.06);
  }
  .av-style-swatch--editorial {
    border-width: 2px 0 0;
    border-color: var(--av-text-primary);
    border-radius: 0;
    font-family: "FrauncesVariable", var(--av-font-serif);
    font-weight: 500;
  }
  .av-style-swatch--soft {
    border-color: transparent;
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-base);
    box-shadow: -3px -3px 6px oklch(var(--av-highlight-color)/0.9), 3px 3px 7px oklch(var(--av-shadow-color)/0.16);
  }
  .av-style-swatch--tactile {
    border-color: var(--av-neutral-800);
    border-radius: var(--av-radius-full);
    background: linear-gradient(180deg, var(--av-neutral-700), var(--av-neutral-900));
    color: var(--av-neutral-0);
    font-family: var(--av-font-mono);
    box-shadow: inset 0 1px 0 oklch(var(--av-highlight-color)/0.2), 0 0 10px -2px var(--av-color-primary);
  }
  .av-style-swatch--bold {
    border: 0;
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
    font-weight: 800;
  }
  .av-style-swatch--glass {
    border-color: oklch(var(--av-highlight-color)/0.6);
    border-radius: var(--av-radius-lg);
    background: linear-gradient(135deg, color-mix(in oklab, var(--av-surface-raised) 55%, transparent), color-mix(in oklab, var(--av-surface-raised) 30%, transparent)), linear-gradient(120deg, var(--av-color-primary), var(--av-accent-500));
  }
  .av-style-swatch--brutal {
    border: 2px solid var(--av-text-primary);
    border-radius: 0;
    box-shadow: 3px 3px 0 var(--av-text-primary);
    font-family: "SpaceGroteskVariable", var(--av-font-sans);
    font-weight: var(--av-font-weight-bold);
    text-transform: uppercase;
  }
  .av-style-swatch--flat {
    border-color: transparent;
    background: var(--av-color-primary-subtle);
  }
  .av-style-swatch--luxe {
    border-color: color-mix(in oklab, var(--av-accent-500) 60%, transparent);
    background: oklch(from var(--av-color-primary) min(l, 0.36) c h);
    color: var(--av-neutral-0);
    font-family: "FrauncesVariable", var(--av-font-serif);
    box-shadow: inset 0 0 0 3px oklch(from var(--av-color-primary) min(l, 0.36) c h), inset 0 0 0 4px color-mix(in oklab, var(--av-accent-500) 45%, transparent);
  }
  .av-style-swatch--organic {
    border-color: color-mix(in oklab, var(--av-color-primary) 30%, var(--av-border-subtle));
    border-start-start-radius: var(--av-radius-xl);
    border-end-end-radius: var(--av-radius-xl);
    background: linear-gradient(160deg, var(--av-surface-raised), var(--av-color-primary-subtle));
  }
  .av-style-swatch--blueprint {
    border: 1px dashed var(--av-color-primary);
    border-radius: 0;
    background: var(--av-surface-raised);
    font-family: var(--av-font-mono);
    text-transform: uppercase;
  }
  .av-style-swatch--duotone {
    border-color: transparent;
    background: linear-gradient(var(--av-surface-raised), var(--av-surface-raised)) padding-box, linear-gradient(135deg, var(--av-accent-500), var(--av-color-primary)) border-box;
    font-weight: 800;
  }
  .av-style-swatch--bento {
    border: 0;
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-sunken);
    box-shadow: inset 0 0 0 5px var(--av-surface-sunken), inset 0 0 0 20px var(--av-surface-raised);
    font-weight: var(--av-font-weight-medium);
  }
  .av-customizer__stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--av-space-3);
  }
  /* Preset swatches */
  .av-swatch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--av-space-2);
  }
  .av-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--av-space-1);
    padding: var(--av-space-2);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    cursor: pointer;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-swatch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }
  .av-swatch__chip {
    inline-size: 100%;
    block-size: 26px;
    border-radius: var(--av-radius-sm);
    /* The chip carries `data-av-preset`, so the preset's own tokens paint it:
       rail, canvas and primary, the three things that tell presets apart. It
       cannot drift from the theme it previews. */
    background: linear-gradient(90deg, var(--av-sidebar-bg) 0 28%, var(--av-surface-base) 28% 64%, var(--av-color-primary) 64% 100%);
    box-shadow: inset 0 0 0 1px oklch(var(--av-shadow-color)/0.06);
  }
  .av-swatch__name {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  .av-swatch:hover {
    border-color: var(--av-border-strong);
  }
  .av-swatch:has(input:checked) {
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 1px var(--av-color-primary);
  }
  .av-swatch:has(input:checked) .av-swatch__name {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-medium);
  }
  .av-swatch:has(input:focus-visible) {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  /* Two-up, for a choice whose chip is a wireframe rather than a colour pair. */
  .av-swatch-grid--pair {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Nav-layout preview ──────────────────────────────────────────────────
     A wireframe of the arrangement, not a word for it: "detached" and "rail"
     name nothing a visitor can picture, and the whole point of the axis is that
     it is seen rather than read. Drawn from two pseudo-elements over a tinted
     ground, so it costs no markup and no image, and it answers to the preset
     like everything else. Logical inset properties throughout, so the previews
     mirror under `dir="rtl"` alongside the layouts they describe. */
  .av-nav-preview {
    position: relative;
    inline-size: 100%;
    block-size: 34px;
    border-radius: var(--av-radius-sm);
    background: var(--av-surface-sunken);
    box-shadow: inset 0 0 0 1px oklch(var(--av-shadow-color)/0.08);
    overflow: hidden;
  }
  .av-nav-preview::before,
  .av-nav-preview::after {
    content: "";
    position: absolute;
    border-radius: var(--av-radius-xs);
    background: var(--av-color-primary);
  }
  /* ::before is the navigation, ::after the content it leaves room for. */
  .av-nav-preview--vertical::before {
    inset-block: 4px;
    inset-inline-start: 4px;
    inline-size: 9px;
  }
  .av-nav-preview--vertical::after {
    inset-block: 4px;
    inset-inline: 17px 4px;
    background: var(--av-border-default);
  }
  .av-nav-preview--rail::before {
    inset-block: 4px;
    inset-inline-start: 4px;
    inline-size: 5px;
  }
  .av-nav-preview--rail::after {
    inset-block: 4px;
    inset-inline: 13px 4px;
    background: var(--av-border-default);
  }
  .av-nav-preview--horizontal::before {
    inset-block-start: 4px;
    inset-inline: 4px;
    block-size: 7px;
  }
  .av-nav-preview--horizontal::after {
    inset-block: 15px 4px;
    inset-inline: 4px;
    background: var(--av-border-default);
  }
  .av-nav-preview--detached::before {
    inset-block: 6px;
    inset-inline-start: 6px;
    inline-size: 9px;
    border-radius: var(--av-radius-sm);
  }
  .av-nav-preview--detached::after {
    inset-block: 6px;
    inset-inline: 19px 6px;
    border-radius: var(--av-radius-sm);
    background: var(--av-border-default);
  }
  /* Mega and stacked both put a bar on top, so the *second* shape is what tells
     them apart and it has to be unmistakable at 34px: mega drops a deep panel,
     stacked lays a second thin rail. Drawn the other way round they read as the
     same picture, which is exactly the "ten demos, six of them alike" problem
     this axis exists to avoid. */
  .av-nav-preview--mega::before {
    inset-block-start: 4px;
    inset-inline: 4px;
    block-size: 6px;
  }
  .av-nav-preview--mega::after {
    inset-block: 13px 4px;
    inset-inline: 4px;
    background: var(--av-color-primary);
    opacity: 0.35;
  }
  .av-nav-preview--stacked::before {
    inset-block-start: 4px;
    inset-inline: 4px;
    block-size: 5px;
  }
  .av-nav-preview--stacked::after {
    inset-block-start: 12px;
    inset-inline: 4px;
    block-size: 5px;
    background: var(--av-border-strong);
  }
  .av-nav-preview--two-column::before {
    inset-block: 4px;
    inset-inline-start: 4px;
    inline-size: 5px;
  }
  .av-nav-preview--two-column::after {
    inset-block: 4px;
    inset-inline-start: 12px;
    inline-size: 9px;
    background: var(--av-border-strong);
  }
  .av-nav-preview--floating::before {
    inset-block-start: 5px;
    inset-inline: 5px;
    block-size: 6px;
    border-radius: var(--av-radius-sm);
  }
  .av-nav-preview--floating::after {
    inset-block: 15px 5px;
    inset-inline: 5px;
    border-radius: var(--av-radius-sm);
    background: var(--av-border-default);
  }
  /* The bar is at the block-end; drawn any other way this is `horizontal`. */
  .av-nav-preview--bottom::before {
    inset-block-end: 4px;
    inset-inline: 4px;
    block-size: 7px;
  }
  .av-nav-preview--bottom::after {
    inset-block: 4px 15px;
    inset-inline: 4px;
    background: var(--av-border-default);
  }
  /* The rail sits *over* the content rather than beside it, so it overlaps and
     the content runs the full width behind it — that overlap is the whole idea
     and the only thing separating this tile from `vertical`. */
  .av-nav-preview--overlay::before {
    inset-block: 4px;
    inset-inline-start: 4px;
    inline-size: 9px;
    z-index: var(--av-z-raised);
  }
  .av-nav-preview--overlay::after {
    inset-block: 4px;
    inset-inline: 4px;
    background: var(--av-border-default);
    opacity: 0.55;
  }
}
@layer components {
  /* Back to top: a floating button the runtime un-hides once the page has
     scrolled one screen ([data-av-back-to-top]). It sits above the footer and,
     on a phone, above the cornered customizer trigger. */
  .av-back-to-top {
    position: fixed;
    inset-block-end: var(--av-space-16);
    inset-inline-end: var(--av-space-8);
    z-index: var(--av-z-sticky);
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    box-shadow: var(--av-shadow-lg);
    color: var(--av-text-primary);
    cursor: pointer;
    transition: opacity var(--av-duration-normal) var(--av-ease-decelerate), translate var(--av-duration-normal) var(--av-ease-decelerate), border-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  @starting-style {
    .av-back-to-top {
      opacity: 0;
      translate: 0 var(--av-space-2);
    }
  }
  .av-back-to-top:hover {
    border-color: var(--av-color-primary-border);
    color: var(--av-color-primary-text);
    translate: 0 var(--av-lift);
  }
  @media (max-width: 575.98px) {
    .av-back-to-top {
      inset-block-end: calc(var(--av-space-16) + var(--av-space-4));
      inset-inline-end: var(--av-space-4);
    }
  }
}
@layer components {
  /* ══ AUTH ═══════════════════════════════════════════════════════════ */
  .av-auth {
    min-block-size: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--av-space-6);
    position: relative;
    isolation: isolate;
    /* The aurora layers below are deliberately oversized (`inset: -25%`) so a
       drifting one never pulls a hard edge into view — which means they hang
       25% outside this box on every side and take the document with them.
       `tests/pages.mjs` caught it immediately: 446px of horizontal overflow on
       every auth page. `clip` rather than `hidden` because this box has no
       reason to become a scroll container, and `hidden` would quietly make it
       one. */
    overflow: clip;
    background: radial-gradient(1200px circle at 12% -10%, oklch(from var(--av-primary-500) l c h/0.16), transparent 55%), radial-gradient(900px circle at 95% 110%, oklch(from var(--av-accent-500) l c h/0.12), transparent 55%), var(--av-surface-base);
  }
  [data-bs-theme=dark] .av-auth {
    background: radial-gradient(1200px circle at 12% -10%, oklch(from var(--av-primary-500) calc(l * 0.7) c h/0.22), transparent 55%), radial-gradient(900px circle at 95% 110%, oklch(from var(--av-accent-500) calc(l * 0.7) c h/0.16), transparent 55%), var(--av-surface-base);
  }
  /* ══ AUTH — the ambient aurora ══════════════════════════════════════
     A slow, non-repeating drift behind the card. Three decisions here are
     load-bearing and none of them is decoration:

     **It is painted from the preset's own ramp, not from sixteen hand-authored
     backgrounds.** Every colour below is `oklch(from var(--av-primary-500) …)`
     or the accent, so every preset get a genuinely different sky — warm on
     ember, ink on noir, teal on harbour — from one set of rules. Sixteen
     bespoke animations would be sixteen things to re-theme, re-test and keep in
     step with the next preset somebody adds; this way a seventeenth preset
     arrives already dressed.

     **The two layers run on deliberately coprime periods (37s and 53s).** A
     single layer, or two on the same period, reads as a loop within about a
     minute and cheapens the whole screen — the composite here does not repeat
     for over half an hour. `alternate` means each layer eases back through its
     own path rather than snapping at the end of a cycle.

     **Only `transform` and `opacity` animate.** Both are compositor-only, so
     the gradients rasterise once and the browser moves the layers without a
     repaint or a single reflow. Animating `background-position` — the obvious
     way to write this — repaints a full-viewport gradient every frame, which is
     exactly the "no layout-triggering animations" line in the review checklist.

     Reduced motion needs nothing here: `utilities/_motion.scss` already stops
     every animation in the document, and `tests/visual.mjs` stills them the
     same way before it captures, so the baselines record the resting state and
     this cannot make the visual gate flaky.

     `inset: -25%` oversizes both layers so a drifting or rotating one never
     pulls a hard edge into view. */
  .av-auth::before,
  .av-auth::after {
    content: "";
    position: absolute;
    inset: -25%;
    z-index: var(--av-z-below);
    pointer-events: none;
    background-repeat: no-repeat;
    will-change: transform;
  }
  .av-auth::before {
    background-image: radial-gradient(38% 42% at 24% 30%, oklch(from var(--av-primary-500) l c h/0.28), transparent 70%), radial-gradient(30% 34% at 76% 16%, oklch(from var(--av-accent-500) l c h/0.22), transparent 70%);
    animation: av-auth-drift-a 37s var(--av-ease-standard) infinite alternate;
  }
  .av-auth::after {
    background-image: radial-gradient(34% 38% at 80% 74%, oklch(from var(--av-accent-500) l c h/0.24), transparent 70%), radial-gradient(28% 32% at 18% 82%, oklch(from var(--av-primary-500) l c h/0.2), transparent 70%);
    animation: av-auth-drift-b 53s var(--av-ease-standard) infinite alternate;
  }
  /* Dark mode darkens the source colour rather than dimming the layer. Dropping
     opacity instead would wash the whole sky towards the page ground and lose
     the hue that identifies the preset — the thing the aurora exists to show. */
  [data-bs-theme=dark] .av-auth::before {
    background-image: radial-gradient(38% 42% at 24% 30%, oklch(from var(--av-primary-500) calc(l * 0.78) c h/0.34), transparent 70%), radial-gradient(30% 34% at 76% 16%, oklch(from var(--av-accent-500) calc(l * 0.78) c h/0.26), transparent 70%);
  }
  [data-bs-theme=dark] .av-auth::after {
    background-image: radial-gradient(34% 38% at 80% 74%, oklch(from var(--av-accent-500) calc(l * 0.78) c h/0.28), transparent 70%), radial-gradient(28% 32% at 18% 82%, oklch(from var(--av-primary-500) calc(l * 0.78) c h/0.24), transparent 70%);
  }
  @keyframes av-auth-drift-a {
    from {
      transform: translate3d(0, 0, 0) scale(1);
    }
    to {
      transform: translate3d(4%, -3%, 0) scale(1.12);
    }
  }
  @keyframes av-auth-drift-b {
    from {
      transform: translate3d(0, 0, 0) scale(1.08);
    }
    to {
      transform: translate3d(-5%, 3%, 0) scale(1);
    }
  }
  .av-auth {
    gap: var(--av-space-5);
    align-content: center;
  }
  .av-auth__demo-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--av-space-1);
    padding: var(--av-space-1);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: color-mix(in oklch, var(--av-surface-raised) 70%, transparent);
    backdrop-filter: blur(8px);
  }
  .av-auth__demo-nav button,
  .av-auth__demo-nav a {
    padding: var(--av-space-1-5) var(--av-space-3);
    border: 0;
    border-radius: var(--av-radius-full);
    background: none;
    color: var(--av-text-muted);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-auth__demo-nav a {
    text-decoration: none;
  }
  .av-auth__demo-nav button:hover,
  .av-auth__demo-nav a:hover {
    color: var(--av-text-primary);
    background: var(--av-surface-sunken);
  }
  .av-auth__demo-nav button.is-active,
  .av-auth__demo-nav a.is-active {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  .av-auth__card {
    /* A stack that exists only inside this card: the inactive pane sits under
       the art, the active one over it, so the sliding panel crosses behind the
       form it is leaving and in front of nothing else. Named rather than
       written as bare 1/2/3 at three separate call sites, and deliberately not
       on the global --av-z-* scale, which starts at 10 and is about layering
       whole regions of the page against each other. */
    --av-z-auth-pane: 1;
    --av-z-auth-art: 2;
    --av-z-auth-pane-active: 3;
    position: relative;
    inline-size: min(1020px, 100%);
    min-block-size: 620px;
    background: var(--av-surface-raised);
    border-radius: var(--av-radius-2xl);
    box-shadow: var(--av-shadow-2xl), 0 0 0 1px oklch(var(--av-shadow-color)/0.06);
    overflow: hidden;
  }
  [data-bs-theme=dark] .av-auth__card {
    box-shadow: var(--av-shadow-2xl), 0 0 0 1px oklch(var(--av-highlight-color)/0.07), inset 0 1px 0 0 oklch(var(--av-highlight-color)/0.05);
  }
  /* Brand / art panel — slides between sides, diagonal edge morphs */
  /* `transform` has no logical form, so the slide direction is carried as a
     sign the RTL rule flips. Without this the panel slid off the right-hand
     edge in RTL instead of across to the other side, and escaped the viewport
     by 341px. */
  .av-auth {
    --av-auth-slide: 1;
  }
  [dir=rtl] .av-auth {
    --av-auth-slide: -1;
  }
  .av-auth__art {
    /* Ink on the art panel, deliberately outside the theme. The panel paints its
       own dark brand gradient in every preset and both colour modes, so text on
       it must not follow --av-text-*: those invert with the mode and would put
       near-black on a near-black panel. Named here so both values sit in one
       place and a preset can still override them. */
    --av-art-ink: oklch(98% 0.005 258);
    --av-art-ink-soft: oklch(88% 0.01 258 / .82);
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    inline-size: 46%;
    z-index: var(--av-z-auth-art);
    display: grid;
    align-items: center;
    overflow: hidden;
    color: var(--av-neutral-0);
    background: radial-gradient(700px circle at 18% 12%, oklch(from var(--av-primary-500) l c h/0.5), transparent 58%), radial-gradient(560px circle at 88% 88%, oklch(from var(--av-accent-500) l c h/0.38), transparent 60%), linear-gradient(165deg, oklch(from var(--av-primary-900) l c h), oklch(from var(--av-primary-950) calc(l * 0.9) c h));
    clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
    transition: transform var(--av-duration-slower) var(--av-ease-emphasized), clip-path var(--av-duration-slower) var(--av-ease-emphasized);
    will-change: transform, clip-path;
  }
  /* Sliding sheen */
  .av-auth__art::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(from 210deg at 50% 50%, transparent 0deg, oklch(from var(--av-accent-500) 80% c h/0.1) 80deg, transparent 160deg, oklch(from var(--av-primary-400) l c h/0.14) 260deg, transparent 360deg);
    animation: av-art-drift 26s linear infinite;
    pointer-events: none;
  }
  /* Fine grain-ish ring */
  .av-auth__art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at 78% 18%, oklch(from var(--av-accent-500) 75% c h/0.14), transparent 62%);
    pointer-events: none;
  }
  @keyframes av-art-drift {
    to {
      transform: rotate(1turn);
    }
  }
  /* Which side the brand panel sits on is a property of the pane, not a list of
     views. It *was* a list — six view names in two rules — and the four auth
     states added later were on neither, so `passwordchanged` and `deactivated`
     rendered with the panel painted straight over the form. Nothing failed:
     the CSS is valid, the pane is `is-active`, and the only symptom is on the
     screen. `:has()` reads the side off the active pane's own modifier, which
     the markup already declares, so a pane added tomorrow is placed correctly
     by construction.

     `:where()` inside `:has()` is what keeps this under the 0-3-0 ceiling —
     `:has()` takes the specificity of its most specific argument, so the plain
     form is 0-4-0. Zeroed, the selector is card + art = 0-2-0, which still
     beats the base rule it overrides. */
  .av-auth__card:has(:where(.av-auth__pane--start.is-active)) .av-auth__art {
    transform: translateX(calc(117.4% * var(--av-auth-slide, 1)));
    clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
  }
  .av-auth__card:has(:where(.av-auth__pane--end.is-active)) .av-auth__art {
    transform: translateX(0);
    clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
  }
  /* The diagonal is a clip-path, which has no logical form either — mirror the
     x coordinates so the cut leans the same way relative to the text. */
  [dir=rtl] .av-auth__art {
    clip-path: polygon(100% 0, 0 0, 14% 100%, 100% 100%);
  }
  [dir=rtl] .av-auth__card:has(:where(.av-auth__pane--start.is-active)) .av-auth__art {
    clip-path: polygon(86% 0, 0 0, 0 100%, 100% 100%);
  }
  [dir=rtl] .av-auth__card:has(:where(.av-auth__pane--end.is-active)) .av-auth__art {
    clip-path: polygon(100% 0, 0 0, 14% 100%, 100% 100%);
  }
  /* The panel is cut by a diagonal, so a symmetric padding is the wrong measure:
     on whichever side the cut leans in, the text ends up against the edge rather
     than inside a margin. At the top of the copy block the cut reaches roughly a
     tenth of the panel width, which left the wordmark ~11px from it.
     `--av-art-clear` is the padding for the cut side, `--av-art-pad` for the flush
     side, and the two swap with the view — the panel slides, so which side is cut
     is state, not direction, and neither `padding-inline-start` nor its logical
     twin can express that on its own. */
  .av-auth__art-inner {
    position: relative;
    display: grid;
    --av-art-pad: clamp(var(--av-space-8), 8.5%, var(--av-space-12));
    --av-art-clear: clamp(var(--av-space-12), 17%, var(--av-space-24));
    /* Near side by default: flush at the start, cut at the end. */
    padding-inline: var(--av-art-pad) var(--av-art-clear);
    padding-block: var(--av-space-10);
  }
  /* Far side (`.av-auth__pane--start` views): the cut moves to the start edge.
     Keyed by view name rather than the pane class itself because the pane
     class lives on the (currently hidden) form pane, not on the art panel
     this rule targets — `passwordchanged` and `deactivated` are
     `--start` panes exactly like signin/forgot/reset and were missing here,
     which left their copy flush against the diagonal instead of clear of it. */
  .av-auth__card[data-av-view=signin] .av-auth__art-inner,
  .av-auth__card[data-av-view=forgot] .av-auth__art-inner,
  .av-auth__card[data-av-view=reset] .av-auth__art-inner,
  .av-auth__card[data-av-view=passwordchanged] .av-auth__art-inner,
  .av-auth__card[data-av-view=deactivated] .av-auth__art-inner {
    padding-inline: var(--av-art-clear) var(--av-art-pad);
  }
  .av-auth__art-copy {
    grid-area: 1/1;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity var(--av-duration-slow) var(--av-ease-standard), transform var(--av-duration-slow) var(--av-ease-standard);
    pointer-events: none;
  }
  .av-auth__art-copy.is-active {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 180ms;
    pointer-events: auto;
  }
  /* The wordmark leads with a short rule — an editorial device that gives the
     eye a start mark, and incidentally makes the left margin legible as a
     deliberate one rather than as text that ran out of room. */
  .av-auth__wordmark {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: oklch(from var(--av-accent-500) 80% calc(c * 0.8) h);
    margin-block-end: var(--av-space-6);
  }
  .av-auth__wordmark::before {
    content: "";
    inline-size: var(--av-space-6);
    block-size: 1px;
    flex: none;
    background: currentcolor;
    opacity: 0.55;
  }
  .av-auth__display {
    font-family: var(--av-font-serif);
    font-weight: var(--av-font-weight-normal);
    font-size: clamp(1.875rem, 1.1rem + 2.1vw, 2.875rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--av-art-ink);
    margin-block-end: var(--av-space-5);
    text-wrap: balance;
  }
  .av-auth__display em {
    font-style: italic;
    color: oklch(from var(--av-accent-500) 82% calc(c * 0.9) h);
  }
  .av-auth__art-text {
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-relaxed);
    color: var(--av-art-ink-soft);
    /* The measure is capped in ch so it tracks the font, but the panel is the
       real constraint — 34ch overflowed the copy into the diagonal on the
       narrowest desktop the art is still shown at. */
    max-inline-size: min(34ch, 100%);
    text-wrap: pretty;
  }
  /* Form panes */
  .av-auth__pane {
    position: absolute;
    inset-block: 0;
    inline-size: 54%;
    display: grid;
    align-items: center;
    padding-inline: clamp(var(--av-space-8), 7.5%, var(--av-space-16));
    opacity: 0;
    visibility: hidden;
    /* The pane enters from the side it lives on, so the offset is directional
       and `translateX` is not. `--av-pane-shift` is the sign; the `[dir]` rule
       below flips it, the same way `--av-auth-slide` already flips the brand
       panel's much larger travel. */
    transform: translateX(calc(-20px * var(--av-pane-shift, 1)));
    transition: opacity var(--av-duration-slow) var(--av-ease-standard), transform var(--av-duration-slow) var(--av-ease-standard), visibility 0s linear var(--av-duration-slow);
    z-index: var(--av-z-auth-pane);
  }
  .av-auth__pane--start {
    inset-inline-start: 0;
  }
  .av-auth__pane--end {
    inset-inline-end: 0;
    transform: translateX(calc(20px * var(--av-pane-shift, 1)));
  }
  [dir=rtl] .av-auth__pane {
    --av-pane-shift: -1;
  }
  .av-auth__pane.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition-delay: 200ms, 200ms, 0s;
    z-index: var(--av-z-auth-pane-active);
  }
  /* The width the card’s content sits in. It belonged to `.av-auth__form`
     alone until the four terminal states arrived, and a screen that reports
     something and offers one button has no form to put it on — wrapping it in
     one for the sake of a class is markup lying about what it does. */
  .av-auth__form,
  .av-auth__panel {
    inline-size: 100%;
    max-inline-size: 400px;
    margin-inline: auto;
  }
  .av-auth__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-3xl);
    font-weight: var(--av-font-weight-bold);
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-block-end: var(--av-space-1);
  }
  .av-auth__subtitle {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    margin-block-end: var(--av-space-8);
  }
  .av-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-4);
    margin-block-end: var(--av-space-6);
    font-size: var(--av-font-size-sm);
  }
  /* The same form on a page that is not an auth card: the "notify me" field on
     the coming-soon screen, which has no card to be the width of and so needs
     one of its own, centred in the column. Its status line centres with it,
     through `.av-field-line__hint--center` in the markup rather than a
     descendant rule here: four elements in the product follow a block button
     and one of them is deliberately left-aligned, so centring by position
     would have changed a page nobody asked about. */
  .av-auth__form--narrow {
    max-inline-size: 380px;
    margin-inline: auto;
  }
  .av-auth__foot {
    margin-block-start: var(--av-space-6);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    text-align: center;
  }
  /* A second foot line belongs to the first, so it takes the smaller gap.
     It was `style="margin-block-start: var(--av-space-2)"` in the markup —
     outside every layer, past the tokens rule, invisible to `lint-css.mjs`. */
  .av-auth__foot--tight {
    margin-block-start: var(--av-space-2);
  }
  .av-auth__social {
    display: flex;
    gap: var(--av-space-3);
  }
  .av-auth__social .av-btn {
    flex: 1;
  }
  .av-auth__back {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    text-decoration: none;
    margin-block-end: var(--av-space-6);
    transition: color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-auth__back:hover {
    color: var(--av-text-primary);
  }
  /* Auth extras: icon head, lock screen ─────────────────────────────── */
  .av-auth__badge-icon {
    display: grid;
    place-items: center;
    inline-size: 52px;
    block-size: 52px;
    margin-block-end: var(--av-space-4);
    border-radius: var(--av-radius-lg);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-auth__badge-icon .av-icon {
    inline-size: 26px;
    block-size: 26px;
  }
  /* A terminal state says which kind it is before it is read: a password was
     changed (success), an account was deactivated (danger). The roles come
     from the one `$status` list rather than being written here, so a new role
     cannot be added to four components and forgotten in a fifth. */
  .av-auth__badge-icon--success {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-auth__badge-icon--warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
  }
  .av-auth__badge-icon--danger {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-auth__badge-icon--info {
    background: var(--av-color-info-subtle);
    color: var(--av-color-info-text);
  }
  .av-auth__lock-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-block-end: var(--av-space-6);
  }
  .av-auth__unlock-row {
    display: flex;
    gap: var(--av-space-2);
    align-items: flex-end;
  }
  .av-auth__unlock-row .av-field-line {
    flex: 1;
    margin-block-end: 0;
  }
  /* `aria-disabled`, not `disabled`: the property blurs the element and drops
     it from the tab order, so a keyboard reader who has just pressed Resend is
     thrown to <body> and handed back nowhere 30 seconds later. `initActions`
     is what makes the attribute refuse the click. */
  .av-resend[aria-disabled=true] {
    color: var(--av-text-disabled);
    cursor: default;
  }
  .av-btn--link {
    background: none;
    border: 0;
    padding: 0;
    min-block-size: 0;
    color: var(--av-text-link);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
  }
  /* Basic variant — a single centred card, the lightest thing to render ── */
  .av-auth--basic .av-auth__card {
    inline-size: min(440px, 100%);
    min-block-size: 0;
    border: 1px solid var(--av-border-subtle);
  }
  .av-auth--basic .av-auth__art {
    display: none;
  }
  .av-auth--basic .av-auth__pane {
    position: static;
    inline-size: 100%;
    padding: var(--av-space-8) var(--av-space-7);
    transform: none;
  }
  .av-auth--basic .av-auth__pane:not(.is-active) {
    display: none;
  }
  .av-auth--basic .av-auth__brand {
    display: flex;
    justify-content: center;
    margin-block-end: var(--av-space-6);
  }
  /* Illustration variant — the basic card over a decorative mesh ──────── */
  .av-auth--illustration .av-auth__card {
    inline-size: min(440px, 100%);
    min-block-size: 0;
    border: 1px solid var(--av-border-subtle);
  }
  .av-auth--illustration .av-auth__art {
    display: none;
  }
  .av-auth--illustration .av-auth__pane {
    position: static;
    inline-size: 100%;
    padding: var(--av-space-8) var(--av-space-7);
    transform: none;
  }
  .av-auth--illustration .av-auth__pane:not(.is-active) {
    display: none;
  }
  .av-auth--illustration .av-auth__brand {
    display: flex;
    justify-content: center;
    margin-block-end: var(--av-space-6);
  }
  .av-auth--illustration::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: var(--av-z-below);
    background: radial-gradient(closest-side circle at 18% 22%, oklch(from var(--av-primary-500) l c h/0.3), transparent), radial-gradient(closest-side circle at 82% 18%, oklch(from var(--av-accent-500) l c h/0.26), transparent), radial-gradient(closest-side circle at 70% 84%, oklch(from var(--av-primary-400) l c h/0.24), transparent), radial-gradient(closest-side circle at 24% 78%, oklch(from var(--av-accent-500) l c h/0.18), transparent);
    background-size: 60% 60%, 50% 50%, 55% 55%, 45% 45%;
    background-repeat: no-repeat;
    filter: blur(24px);
    animation: av-mesh-drift 26s var(--av-ease-standard) infinite alternate;
  }
  @keyframes av-mesh-drift {
    to {
      background-position: 6% 4%, -5% 6%, 4% -5%, -4% -3%;
    }
  }
  /* The grid overlay reads as texture rather than decoration at low opacity. */
  .av-auth--illustration::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: var(--av-z-below);
    background-image: linear-gradient(to right, var(--av-border-subtle) 1px, transparent 1px), linear-gradient(to bottom, var(--av-border-subtle) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.5;
    mask-image: radial-gradient(closest-side circle at 50% 50%, #000 30%, transparent 85%);
    pointer-events: none;
  }
  /* Compact (art hidden below lg per docs) */
  @media (max-width: 991.98px) {
    .av-auth__card {
      inline-size: min(440px, 100%);
      min-block-size: 0;
    }
    .av-auth__art {
      display: none;
    }
    .av-auth__pane {
      position: static;
      inline-size: 100%;
      padding: var(--av-space-8) var(--av-space-6);
      transform: none;
    }
    .av-auth__pane:not(.is-active) {
      display: none;
    }
  }
}
@layer components {
  /* OTP input ───────────────────────────────────────────────────────── */
  .av-otp__inputs {
    display: flex;
    gap: var(--av-space-2);
    justify-content: space-between;
  }
  .av-otp__input {
    inline-size: 100%;
    max-inline-size: 52px;
    block-size: 56px;
    text-align: center;
    font-size: var(--av-font-size-xl);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
    color: var(--av-text-primary);
    background: var(--av-surface-sunken);
    border: 1.5px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    caret-color: var(--av-color-primary);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-otp__input:focus {
    outline: none;
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--av-color-primary) 22%, transparent);
    background: var(--av-surface-raised);
  }
  .av-otp__input.is-filled {
    border-color: var(--av-color-primary-border);
    background: var(--av-color-primary-subtle);
  }
  .av-otp.is-error .av-otp__input {
    border-color: var(--av-color-danger);
    animation: av-otp-shake var(--av-duration-slow) var(--av-ease-standard);
  }
  @keyframes av-otp-shake {
    20%, 60% {
      translate: -4px 0;
    }
    40%, 80% {
      translate: 4px 0;
    }
  }
}
@layer components {
  /* Password strength meter ─────────────────────────────────────────── */
  .av-strength {
    display: flex;
    gap: var(--av-space-1-5);
    margin-block-start: var(--av-space-2);
  }
  .av-strength span {
    flex: 1;
    block-size: 4px;
    border-radius: var(--av-radius-full);
    background: var(--av-border-subtle);
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-strength[data-av-score="1"] span:nth-child(-n+1) {
    background: var(--av-color-danger);
  }
  .av-strength[data-av-score="2"] span:nth-child(-n+2) {
    background: var(--av-color-warning);
  }
  .av-strength[data-av-score="3"] span:nth-child(-n+3) {
    background: var(--av-color-info);
  }
  .av-strength[data-av-score="4"] span:nth-child(-n+4) {
    background: var(--av-color-success);
  }
  .av-field-line__error {
    display: none;
    font-size: var(--av-font-size-xs);
    color: var(--av-color-danger-text);
    margin-block-start: var(--av-space-1-5);
  }
  .av-field-line.is-invalid .av-field-line__error {
    display: block;
  }
  .av-field-line.is-invalid .av-field-line__control {
    border-color: var(--av-color-danger);
  }
  .av-field-line.is-invalid .av-field-line__label {
    color: var(--av-color-danger-text);
  }
}
@layer components {
  /* Error / utility pages ───────────────────────────────────────────── */
  .av-error {
    min-block-size: 100dvh;
    display: grid;
    place-items: center;
    padding: var(--av-space-6);
    text-align: center;
    position: relative;
    isolation: isolate;
    background: radial-gradient(900px circle at 50% -10%, oklch(from var(--av-primary-500) l c h/0.14), transparent 60%), var(--av-surface-base);
  }
  .av-error__inner {
    max-inline-size: 560px;
  }
  .av-error__code {
    font-family: var(--av-font-display);
    font-size: clamp(5rem, 18vw, 10rem);
    font-weight: var(--av-font-weight-black);
    line-height: 1;
    letter-spacing: var(--av-tracking-tighter);
    background: linear-gradient(135deg, var(--av-primary-500), var(--av-accent-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-block-end: var(--av-space-4);
  }
  .av-error__badge {
    display: grid;
    place-items: center;
    inline-size: 72px;
    block-size: 72px;
    /* Block-level + auto inline margins: an inline-level badge would share a line
       with the status pill above it. */
    margin-inline: auto;
    margin-block-end: var(--av-space-5);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary);
  }
  .av-error__badge .av-icon {
    inline-size: 34px;
    block-size: 34px;
  }
  .av-error__title {
    font-size: var(--av-font-size-3xl);
    font-weight: var(--av-font-weight-bold);
    letter-spacing: -0.02em;
    margin-block-end: var(--av-space-2);
  }
  .av-error__text {
    color: var(--av-text-muted);
    margin-block-end: var(--av-space-6);
    text-wrap: pretty;
  }
  .av-error__actions {
    display: flex;
    gap: var(--av-space-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-block-end: var(--av-space-8);
  }
  .av-error__help {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  .av-error__brand {
    position: absolute;
    inset-block-start: var(--av-space-6);
    inset-inline-start: var(--av-space-6);
  }
  .av-error__status {
    display: flex;
    inline-size: fit-content;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-1-5) var(--av-space-3);
    margin-inline: auto;
    margin-block-end: var(--av-space-5);
    border: 1px solid var(--av-color-warning-border);
    border-radius: var(--av-radius-full);
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
  }
  .av-error__dot {
    inline-size: 8px;
    block-size: 8px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-warning);
    animation: av-pulse 1.8s var(--av-ease-standard) infinite;
  }
  .av-error__status--danger {
    border-color: var(--av-color-danger-border);
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-error__status--danger .av-error__dot {
    background: var(--av-color-danger);
  }
  @keyframes av-pulse {
    50% {
      opacity: 0.35;
      scale: 0.8;
    }
  }
}
@layer components {
  /* Customer cards ──────────────────────────────────────────────────── */
  .av-customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--av-space-4);
  }
  .av-customer-card {
    display: flex;
    flex-direction: column;
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-sm);
    overflow: hidden;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-customer-card:hover {
    border-color: var(--av-border-default);
    box-shadow: var(--av-shadow-md);
  }
  [data-bs-theme=dark] .av-customer-card {
    box-shadow: 0 1px 3px 0 oklch(var(--av-shadow-color)/0.4), inset 0 1px 0 0 oklch(var(--av-highlight-color)/0.04);
  }
  .av-customer-card__head {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-5) var(--av-space-5) var(--av-space-4);
  }
  .av-customer-card__id {
    flex: 1;
    min-inline-size: 0;
  }
  .av-customer-card__name {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  .av-customer-card__meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin: 2px 0 0;
  }
  .av-customer-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--av-space-2);
    margin: 0;
    padding: var(--av-space-4) var(--av-space-5);
    border-block: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
  }
  .av-customer-card__stats dt {
    font-size: var(--av-font-size-2xs);
    letter-spacing: var(--av-tracking-wide);
    text-transform: uppercase;
    color: var(--av-text-muted);
  }
  .av-customer-card__stats dd {
    margin: 2px 0 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  /* A row of labels between the stats and the actions. Named for what it is
     rather than for the first page that needed it — the qualification board
     puts four answers here, and the next card to use it will put something
     else. Chips wrap rather than scroll: a card is a fixed width and a label
     pushed out of sight is a label nobody reads. */
  .av-customer-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    margin: 0;
    padding: var(--av-space-4) var(--av-space-5) 0;
  }
  .av-customer-card__foot {
    display: flex;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-5);
  }
}
@layer components {
  /* Profile hero ────────────────────────────────────────────────────────
     The cover-plus-avatar header that opens every profile, account and team
     page. Two details are load-bearing:

     The avatar overlaps the cover by a negative *block* margin on the body
     rather than absolute positioning. Absolute positioning needs a fixed cover
     height to place against, and the cover here is a ratio — so the overlap
     would drift at every breakpoint and be wrong in exactly one of them.

     The stats row is `flex-wrap` with a start-aligned gap, not a fixed grid.
     A profile carries three stats on one page and five on another, and a grid
     with a hard column count leaves a gap where the fifth would be. */
  .av-profile-hero {
    overflow: hidden;
  }
  /* Three background layers in one declaration, and the ordering is a fix
     rather than a flourish.

     The sheen used to be an `::after` with `inset: 0`. That is a *positioned*
     element inside an otherwise static header, so it painted above the body
     that follows it in the DOM — and washed out the top half of the avatar
     that deliberately overlaps the cover. It read as a clipped avatar, which
     sends you looking at `overflow` and `border-radius`, where there is
     nothing to find.

     As background layers there is no stacking question left to get wrong:
     first listed paints on top, all three belong to the cover, and none of
     them can reach past its own box. The dot texture is mixed from
     `--av-text-on-primary` — the token the generator already computes to sit
     legibly on the brand colour — so it stays visible on a pale preset and on
     an ink one without a second rule. */
  .av-profile-hero__cover {
    aspect-ratio: 5/1;
    min-block-size: 132px;
    background-image: radial-gradient(circle at 1px 1px, color-mix(in oklch, var(--av-text-on-primary) 20%, transparent) 1px, transparent 0), var(--av-gradient-sheen), var(--av-gradient-brand);
    background-size: 22px 22px, auto, auto;
  }
  .av-profile-hero__body {
    display: flex;
    align-items: flex-end;
    gap: var(--av-space-5);
    flex-wrap: wrap;
    padding: 0 var(--av-space-6) var(--av-space-5);
    /* The avatar overlaps the cover by a negative *block* margin rather than by
       absolute positioning. Absolute positioning needs a fixed cover height to
       place against, and this cover is a ratio — so the overlap would drift at
       every breakpoint and be wrong at exactly one of them. */
    margin-block-start: calc(var(--av-space-10) * -1);
    position: relative;
  }
  /* The ring is the card's own surface, so the avatar reads as punched out of
     the header rather than pasted on top of it — and it keeps working on all
     every preset, because the ring is a surface token rather than white. */
  .av-profile-hero__avatar {
    flex: none;
    inline-size: 104px;
    block-size: 104px;
    font-size: var(--av-font-size-3xl);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    box-shadow: 0 0 0 4px var(--av-surface-raised), var(--av-shadow-lg);
  }
  .av-profile-hero__identity {
    flex: 1;
    min-inline-size: 0;
    padding-block-end: var(--av-space-1);
  }
  .av-profile-hero__name {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    flex-wrap: wrap;
    font-size: var(--av-font-size-xl);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-profile-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-1) var(--av-space-4);
    margin-block-start: var(--av-space-1);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-profile-hero__meta > * {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
  }
  .av-profile-hero__actions {
    display: flex;
    gap: var(--av-space-2);
    flex-wrap: wrap;
    padding-block-end: var(--av-space-1);
  }
  /* Stat strip ──────────────────────────────────────────────────────────
     Sits below the identity row, separated by a rule rather than by a card of
     its own: it describes the person above it, and a second card would read as
     a second subject. */
  .av-profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-5) var(--av-space-8);
    padding: var(--av-space-4) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-profile-stats__item {
    min-inline-size: 0;
  }
  .av-profile-stats__value {
    display: block;
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-profile-stats__label {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
}
@layer components {
  /* Tab-shaped navigation ───────────────────────────────────────────────
     Looks like `.av-tabs` and is deliberately not it. `.av-tabs` implements
     the ARIA tabs pattern — `role="tablist"`, roving tabindex, panels shown
     and hidden in place. This is a row of links to *other pages*, which is a
     navigation landmark with an `aria-current="page"`, and giving it
     `role="tab"` would promise a panel that never arrives and break the
     arrow-key contract a screen-reader user expects from a tablist.

     Profile and account sections use it: the header stays, the body changes,
     and the URL changes with it — which is the difference that decides which
     of the two components is correct. */
  .av-tab-nav {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
    overflow-x: auto;
    scrollbar-width: thin;
    border-block-end: 1px solid var(--av-border-subtle);
    margin-block-end: var(--av-space-5);
  }
  /* The fade that says "there is more this way" ─────────────────────────
     Applied to any rail carrying `data-av-scrollnav`, so one rule serves the
     account tabs and the settings rail without either knowing about the other.

     The classes are set from measured scroll position by `initScrollNav`, never
     assumed: a rail that fits its screen must show no fade at all, or the
     affordance becomes decoration and stops meaning anything. A phone paints no
     scrollbar, so without this the row simply ends in a tab sliced in half.

     `mask-image` gradients take a physical direction, so the two stops are
     carried in custom properties that the RTL rule swaps — the same contract
     the `directional-transform` rule enforces for translate. */
  [data-av-scrollnav] {
    /* Opaque by default: a rail that fits shows no fade at all. Getting this
       backwards — defaulting to transparent — fades both edges of every rail
       permanently, including ones with nothing hidden, and the affordance stops
       meaning anything.

       These are mask alphas, not theme colours: `#000` is "keep this pixel" and
       `#0000` is "fade it out". There is no token for an alpha channel and one
       would be wrong here — the value must not change with the preset. */
    --av-nav-fade-start: #000;
    --av-nav-fade-end: #000;
    -webkit-mask-image: linear-gradient(to right, var(--av-nav-fade-start) 0, #000 var(--av-space-8), #000 calc(100% - var(--av-space-8)), var(--av-nav-fade-end) 100%);
    mask-image: linear-gradient(to right, var(--av-nav-fade-start) 0, #000 var(--av-space-8), #000 calc(100% - var(--av-space-8)), var(--av-nav-fade-end) 100%);
    /* The scrollbar is the desktop affordance and the fade is the touch one;
       showing both stacks a grey bar under a fading tab. */
    scrollbar-width: none;
  }
  [data-av-scrollnav]::-webkit-scrollbar {
    block-size: 0;
  }
  /* Physical names on purpose. A mask gradient has no logical form, so rather
     than flipping the CSS under [dir="rtl"] — which needs both properties set
     in both rules and then fights itself when a rail overflows at both ends —
     `initScrollNav` resolves direction once and reports which *physical* edge
     has content behind it. One pair of rules, no RTL branch. */
  [data-av-scrollnav].is-scroll-left {
    --av-nav-fade-start: #0000;
  }
  [data-av-scrollnav].is-scroll-right {
    --av-nav-fade-end: #0000;
  }
  .av-tab-nav__link {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-3);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
    text-decoration: none;
    white-space: nowrap;
    /* The indicator is a transparent border in the resting state rather than
       a border added on the active one, so the row does not shift by 2px when
       the selection moves. */
    border-block-end: 2px solid transparent;
    margin-block-end: -1px;
    transition: color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-tab-nav__link:hover {
    color: var(--av-text-primary);
  }
  .av-tab-nav__link[aria-current=page] {
    color: var(--av-color-primary-text);
    border-block-end-color: var(--av-color-primary);
  }
  .av-tab-nav__count {
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-muted);
    background: var(--av-surface-sunken);
    border-radius: var(--av-radius-full);
    padding: 1px var(--av-space-1-5);
    font-variant-numeric: tabular-nums lining-nums;
  }
  /* The row scrolls on narrow screens; a trailing action must not scroll with
     it, so it lives outside the scroller in a wrapper. */
  .av-tab-nav-bar {
    display: flex;
    align-items: center;
    gap: var(--av-space-4);
  }
  .av-tab-nav-bar > .av-tab-nav {
    flex: 1;
    min-inline-size: 0;
  }
  /* The rail carries the section's bottom rule, so it sits flush against the
     block it controls — a gap there reads as the rule belonging to neither.
     This says out loud what used to be said by the absence of anything, which
     stopped being enough the moment the page body gained a default rhythm. */
  .av-tab-nav-bar + * {
    margin-block-start: 0;
  }
  .av-tab-nav-bar__actions {
    flex: none;
    display: flex;
    gap: var(--av-space-2);
    padding-block-end: var(--av-space-2);
  }
  /* Second level ─────────────────────────────────────────────────────────
     The account rail measured 1,118px inside a 1,118px box with twelve
     sections in it — full, to the pixel. Six more would have made it scroll
     horizontally, which is exactly what the messages drawer was rescued *from*
     and for the same reason: a strip that hides half its own options is not a
     navigation, it is a navigation plus a scrollbar.

     So the six new screens hang off the three sections they belong to rather
     than joining the top row. Deliberately *not* `.av-tab-nav` again — two
     identical underlined rails stacked read as one broken rail, and the reader
     cannot tell which level they are on. Pills, no rule beneath them, and a
     step down in weight. */
  .av-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-1);
    /* The rail above already carries the section's bottom rule and its own
       margin, so this sits in that gap rather than adding a second one. */
    margin-block: calc(var(--av-space-4) * -1) var(--av-space-5);
  }
  .av-subnav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-1-5) var(--av-space-3);
    border-radius: var(--av-radius-full);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
    text-decoration: none;
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard), color var(--av-duration-fastest) var(--av-ease-standard);
  }
  .av-subnav__link:hover {
    color: var(--av-text-primary);
    background: var(--av-surface-sunken);
  }
  .av-subnav__link[aria-current=page] {
    color: var(--av-color-primary-text);
    background: var(--av-color-primary-subtle);
    font-weight: var(--av-font-weight-medium);
  }
}
@layer components {
  /* Onboarding checklist ────────────────────────────────────────────────
     The "get started" list every SaaS shows a new account. It is an ordered
     list of real steps, not a decoration, so it is marked up as one: the
     numbers come from the list itself and the completed state is carried on
     the item rather than inferred from position, because a person can finish
     step three before step two.

     The connector between markers is drawn by the marker's own ::after rather
     than a border on the item, so the last step has nothing to trim — an
     `:last-child` override is the usual way this is done and it breaks the
     moment a step is inserted by a template loop that reorders. */
  .av-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--av-space-1);
  }
  .av-checklist__item {
    display: flex;
    gap: var(--av-space-3);
    padding: var(--av-space-3);
    border-radius: var(--av-radius-lg);
    position: relative;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-checklist__item:hover {
    background: var(--av-surface-sunken);
  }
  .av-checklist__marker {
    flex: none;
    inline-size: 26px;
    block-size: 26px;
    display: grid;
    place-items: center;
    border-radius: var(--av-radius-full);
    border: 1px solid var(--av-border-default);
    background: var(--av-surface-base);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums lining-nums;
    position: relative;
  }
  /* The rail. Drawn downward from each marker and hidden on the last item by
     the item's own state rather than by :last-child, so a filtered or
     reordered list still terminates correctly. */
  .av-checklist__marker::after {
    content: "";
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: 50%;
    inline-size: 1px;
    block-size: var(--av-space-4);
    background: var(--av-border-subtle);
    transform: translateX(-50%);
  }
  .av-checklist__item:last-child .av-checklist__marker::after {
    content: none;
  }
  .av-checklist__item--done .av-checklist__marker {
    border-color: var(--av-color-success);
    background: var(--av-color-success);
    color: var(--av-text-on-primary);
  }
  .av-checklist__item--active .av-checklist__marker {
    border-color: var(--av-color-primary);
    color: var(--av-color-primary-text);
    background: var(--av-color-primary-subtle);
  }
  .av-checklist__body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-checklist__title {
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  /* Completed steps keep their text legible rather than being struck through:
     the point of the list is that you can still read what you did. */
  .av-checklist__item--done .av-checklist__title {
    color: var(--av-text-secondary);
  }
  .av-checklist__text {
    margin: 2px 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-checklist__action {
    flex: none;
    align-self: center;
  }
  /* Progress summary above the list. */
  .av-checklist-meter {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    margin-block-end: var(--av-space-4);
  }
  .av-checklist-meter__count {
    flex: none;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-checklist-meter__bar {
    flex: 1;
    min-inline-size: 0;
  }
}
@layer components {
  /* Permission / preference matrix ──────────────────────────────────────
     A grid of checkboxes with roles or channels across the top and capabilities
     down the side. It is a real <table>, and that is the whole accessibility
     story: a lone checkbox in a cell is meaningless, but a checkbox inside a
     cell with a row header and a column header is announced as "Delete
     invoices, Editor, checkbox, not checked". Replace the table with divs and
     that sentence disappears.

     The design premise, which the first version missed: **a matrix is read as a
     shape, not as ninety individual controls.** Nobody audits a permission grid
     by looking at one box; they look for the block of ticks at the bottom of the
     Billing column and the gap in the middle of Viewer. So the checked *cell* is
     tinted, not just the box inside it — that is what turns a field of identical
     squares into a pattern you can read at arm's length, and it is the single
     change here that does the most work.

     The row header is sticky on the inline axis so the capability stays readable
     while the columns scroll — a matrix wide enough to need this is exactly the
     one where you lose track of which row you are on.

     `--av-matrix-label` is the row-header width, declared once so the sticky
     offset and the column sizing cannot disagree. `--av-check-size` is set here
     rather than on each of the ninety inputs; `components/_check.scss` reads it
     by inheritance. */
  .av-matrix {
    --av-matrix-label: 260px;
    --av-check-size: 20px;
    /* The wash under a granted cell. Low enough to sit behind text without
       fighting it, strong enough that a column of them reads as a block. */
    --av-matrix-on: color-mix(in oklab, var(--av-color-primary) 7%, transparent);
    inline-size: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--av-font-size-sm);
  }
  /* The cell is padded by the label inside it, not by the cell, so the whole
     rectangle is the hit target — see `.av-matrix__cell`. The row header keeps
     its own padding because it holds prose. */
  .av-matrix td {
    padding: 0;
    text-align: center;
    vertical-align: middle;
  }
  .av-matrix th {
    padding: var(--av-space-3) var(--av-space-4);
    vertical-align: middle;
  }
  .av-matrix tbody td,
  .av-matrix tbody th {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  /* ── The header ───────────────────────────────────────────────────────
     Not a strip of small grey words with a stray checkbox after them. Each
     column is a name, and under it one control that says what it does. */
  .av-matrix thead th {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-raised);
    background: var(--av-surface-raised);
    border-block-end: 1px solid var(--av-border-default);
    padding-block: var(--av-space-3-5);
    text-align: center;
    font-weight: var(--av-font-weight-normal);
  }
  .av-matrix__col {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--av-space-1-5);
  }
  .av-matrix__col-name {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  /* "Select every capability in this column." It was a bare checkbox with the
     word `all` after it, which read as debris left in the header rather than as
     a control. As a pill it is legible at rest, obviously pressable, and it
     reports its own state: the three-state box drives the pill's fill through
     `:has`, so a half-selected column looks half-selected from across the room
     as well as to a screen reader. */
  .av-matrix__all {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    padding-block: var(--av-space-1);
    padding-inline: var(--av-space-1-5) var(--av-space-2);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-base);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
    cursor: pointer;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), border-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-matrix__all:hover {
    border-color: var(--av-border-strong);
    color: var(--av-text-secondary);
  }
  .av-matrix__all:has(:checked),
  .av-matrix__all:has(:indeterminate) {
    background: var(--av-color-primary-subtle);
    border-color: var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  .av-matrix__all .av-check {
    --av-check-size: 14px;
  }
  /* Owner, and the email channel on a security alert: fixed by design. It says
     so in words, because a tick that cannot be unticked and never explains why
     is the control people file a bug about. */
  .av-matrix__fixed {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1);
    padding-block: var(--av-space-1);
    padding-inline: var(--av-space-2);
    border-radius: var(--av-radius-full);
    background: var(--av-color-neutral-subtle);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-medium);
    /* secondary rather than muted, because this pill paints its own lighter ground:
       muted is measured against the page surface and lands at 4.3:1 on
       `--av-color-neutral-subtle` in dark mode. A token that clears AA on the page does
       not automatically clear it on a raised fill. */
    color: var(--av-text-secondary);
  }
  .av-matrix__fixed .av-icon {
    inline-size: 11px;
    block-size: 11px;
  }
  /* ── The row header ───────────────────────────────────────────────────
     The one cell in the table that is not centred, because it reads as prose.

     It says `.av-matrix .av-matrix__label` rather than `.av-matrix__label`, and
     the extra class is load-bearing: `.av-matrix th` is 0-1-1 and beat the
     0-1-0 the alignment used to be written at, so every capability name on both
     pages had been rendering centred inside a start-aligned column since the
     component was written. It read as a broken `text-align` and it was a
     specificity contest — the fifth one recorded in this codebase. */
  .av-matrix .av-matrix__label {
    inline-size: var(--av-matrix-label);
    min-inline-size: var(--av-matrix-label);
    text-align: start;
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
    position: sticky;
    inset-inline-start: 0;
    background: var(--av-surface-raised);
    /* Sticky alone is not enough. A positioned element with `auto` z-index does
       not create a stacking context, so the cells *after* it in source order
       paint on top — and this cell is the first in its row. Scrolling the
       matrix sideways would slide every role column over the capability name it
       belongs to, which is the one label that has to stay readable. */
    z-index: var(--av-z-raised);
  }
  /* The corner cell is sticky on both axes, so it has to outrank the column
     headers it scrolls under as well as the rows it scrolls over. */
  .av-matrix thead .av-matrix__label {
    z-index: var(--av-z-sticky);
    text-align: start;
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wider);
    color: var(--av-text-muted);
  }
  .av-matrix__hint {
    display: block;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-muted);
    margin-block-start: var(--av-space-0-5);
  }
  /* An icon ahead of the row label — opt-in per row, not part of `.av-matrix`
     itself. The permission grid's capabilities ("Delete invoices") have no icon
     to lead with; the delivery matrix's event types do. */
  .av-matrix__label-row {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
  }
  .av-matrix__label-icon {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 32px;
    block-size: 32px;
    border-radius: var(--av-radius-md);
    border: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
  }
  .av-matrix__label-icon .av-icon {
    inline-size: 16px;
    block-size: 16px;
  }
  /* ── The cell ─────────────────────────────────────────────────────────
     A label filling the whole cell, so the target is the rectangle rather than
     the 20px box in the middle of it. On a grid this size that is the
     difference between a control you aim at and one you point at. */
  .av-matrix__cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-block-size: 52px;
    padding-inline: var(--av-space-4);
    cursor: pointer;
  }
  .av-matrix__cell:has(:disabled) {
    cursor: default;
  }
  /* A cell whose content is not itself one big click target: a derived badge, a
     read-only grant, or a three-way control carrying its own labels. The default
     cell stretches a <label> across the whole rectangle and points at it, which
     is right when the rectangle *is* the control and a promise the cell cannot
     keep when it is not. The block padding is added on top of the inherited 52px
     floor rather than replacing it: a segmented control is taller than a
     checkbox and would otherwise sit against the row rule. */
  .av-matrix__cell--plain {
    cursor: default;
    padding-block: var(--av-space-2);
  }
  /* The pattern. A granted cell is tinted; the column of them is the shape you
     actually read the table for. Attribute-scoped so a fixed cell — Owner, or a
     security alert that always goes by email — stays neutral: those are not a
     decision anybody made and should not join the pattern. */
  .av-matrix td[data-av-matrix-col]:has(:checked) {
    background: var(--av-matrix-on);
  }
  .av-matrix tbody tr:hover td,
  .av-matrix tbody tr:hover th {
    background: var(--av-surface-sunken);
  }
  .av-matrix tbody tr:hover td[data-av-matrix-col]:has(:checked) {
    background: color-mix(in oklab, var(--av-color-primary) 12%, transparent);
  }
  /* ── The group break ──────────────────────────────────────────────────
     It was a full-bleed grey slab with a word in it — the single most dated
     thing on the page, and it cut the table in half at every heading rather
     than grouping the rows under it.

     Now it is an eyebrow on the table's own surface with a short accent rule
     leading it, and the space belongs above rather than below, because a
     heading opens the block beneath it. No fill and no rule across the columns:
     a group of rows reads as a group because of the space around it. */
  .av-matrix__section th {
    padding-block: var(--av-space-6) var(--av-space-2);
    background: var(--av-surface-raised);
    text-align: start;
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wider);
    color: var(--av-text-secondary);
  }
  .av-matrix tbody .av-matrix__section:first-child th {
    padding-block-start: var(--av-space-4);
  }
  .av-matrix__section th::before {
    content: "";
    display: inline-block;
    inline-size: 14px;
    block-size: 2px;
    margin-inline-end: var(--av-space-2);
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    vertical-align: middle;
  }
  /* The break carries no rule of its own — the row under it draws one. */
  .av-matrix tbody .av-matrix__section th {
    border-block-start: 0;
  }
  /* Below the label width there is nothing to scroll to that helps: the columns
     are already at their minimum and the sticky header is more chrome than
     table. Hand the label column back its space and let the wrapper scroll. */
  @media (width < 48rem) {
    .av-matrix {
      --av-matrix-label: 180px;
      --av-check-size: 18px;
    }
    .av-matrix__cell {
      min-block-size: 46px;
      padding-inline: var(--av-space-2);
    }
    .av-matrix th {
      padding-inline: var(--av-space-3);
    }
  }
}
@layer components {
  /* Secret field ────────────────────────────────────────────────────────
     A credential shown in a table or a card: masked by default, revealed on
     request, copied without ever being selected by hand.

     The value is a real element with real text rather than a CSS-obscured
     one. Masking with `-webkit-text-security` or a filter leaves the secret in
     the DOM, in the accessibility tree, and in the clipboard of anyone who
     drags across it — which is the one thing a masked field must not do. The
     module swaps the *text*, so what is hidden is genuinely absent. */
  .av-secret {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    max-inline-size: 100%;
  }
  .av-secret__value {
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    padding: var(--av-space-1) var(--av-space-2);
    white-space: nowrap;
    /* No fixed width, and that is the point: every mask is the same length —
       the bullet count is constant and only the last four characters vary — so
       natural sizing already lines every row of the table up. A hand-picked
       `inline-size` did not, because the box is border-box and the value has
       padding, so 13ch of box held twelve characters and grew a scrollbar
       inside a control twelve characters long.

       `overflow-x` stays as the safety net for the one case that can still
       overflow: a *revealed* key in a narrow cell. */
    max-inline-size: 100%;
    overflow-x: auto;
    flex: none;
  }
  .av-secret__actions {
    display: inline-flex;
    gap: var(--av-space-1);
    flex: none;
  }
}
@layer components {
  /* Integration card ────────────────────────────────────────────────────
     The connect-an-app tile. The connected state is carried on the card by an
     attribute rather than a class, because it is enumerated — connected,
     available, unavailable — and an attribute makes an impossible pair
     (`is-connected is-available`) unrepresentable rather than merely
     discouraged. */
  .av-integration-grid {
    display: grid;
    gap: var(--av-space-4);
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
  .av-integration {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-3);
    padding: var(--av-space-4);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-raised);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-integration:hover {
    border-color: var(--av-border-strong);
    box-shadow: var(--av-shadow-sm);
  }
  .av-integration[data-av-state=connected] {
    border-color: var(--av-color-success-border);
  }
  .av-integration__head {
    display: flex;
    align-items: flex-start;
    gap: var(--av-space-3);
  }
  .av-integration__logo {
    flex: none;
    inline-size: 40px;
    block-size: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    color: var(--av-text-secondary);
  }
  .av-integration__name {
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-integration__category {
    display: block;
    font-size: var(--av-font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
  .av-integration__text {
    margin: 0;
    flex: 1;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* A machine name under the human one: a package, a namespace, an endpoint.
     It breaks anywhere because it has no spaces, and an unbreakable string is
     exactly what pushes a 260px card wider than its track. */
  .av-integration__meta {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    overflow-wrap: anywhere;
  }
  .av-integration__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-2);
    padding-block-start: var(--av-space-3);
    border-block-start: 1px solid var(--av-border-subtle);
  }
}
@layer components {
  /* Usage meter list ────────────────────────────────────────────────────
     "You have used 8,200 of 10,000 API calls." Each row is a labelled
     progress bar; the bar itself is `.av-progress`, so the ARIA and the
     motion behaviour come from the component that already has them rather
     than being written twice.

     The over-limit state is a *modifier on the row*, not a colour written
     into the bar, so one place decides what "over" looks like. */
  .av-usage {
    display: grid;
    gap: var(--av-space-4);
    margin: 0;
  }
  .av-usage__row {
    min-inline-size: 0;
  }
  .av-usage__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-3);
    margin-block-end: var(--av-space-1-5);
  }
  .av-usage__label {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-usage__value {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-usage__foot {
    margin-block-start: var(--av-space-1-5);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-usage__row--warn .av-usage__value {
    color: var(--av-color-warning-text);
  }
  .av-usage__row--warn .av-progress__bar {
    background: var(--av-color-warning);
  }
  .av-usage__row--over .av-usage__value {
    color: var(--av-color-danger-text);
  }
  .av-usage__row--over .av-progress__bar {
    background: var(--av-color-danger);
  }
}
@layer components {
  /* Policy list ─────────────────────────────────────────────────────────
     A list of things that each carry one permission: an agent tool that may
     always run, must ask first, or is blocked; a webhook event that is sent,
     queued or dropped. Each row is the thing's name and what it says about
     itself, a three-state `.av-segmented` control, and an optional detail
     panel (an input schema, a payload sample) that spans the whole row.

     It is a list rather than a table because the control is wide and the
     description is long. In a table the two fight for one line and the
     description loses; here the row is a size container, so below 34rem the
     control drops under the text instead of squeezing it.

     A row whose permission is fixed by somebody else carries
     `.av-policy__locked` in place of the control. That is a sentence, not a
     disabled radio group: a group nobody can change is still announced as
     something to operate, and the reader learns why only by failing to. */
  .av-policy {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-policy__item {
    container-type: inline-size;
    padding-block: var(--av-space-4);
  }
  .av-policy__item + .av-policy__item {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-policy__item:first-child {
    padding-block-start: 0;
  }
  .av-policy__item:last-child {
    padding-block-end: 0;
  }
  .av-policy__row {
    display: grid;
    gap: var(--av-space-3);
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  @container (min-width: 34rem) {
    .av-policy__row {
      grid-template-columns: minmax(0, 1fr) auto;
    }
  }
  .av-policy__main {
    min-inline-size: 0;
  }
  .av-policy__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-2);
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
    overflow-wrap: anywhere;
  }
  .av-policy__text {
    margin: var(--av-space-1) 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-policy__hints {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-1-5);
    margin-block-start: var(--av-space-2);
  }
  /* The control keeps its natural width at desktop and takes the row at
     phone width, where three equal segments are easier to hit than three
     shrunk to their labels. */
  .av-policy__control {
    min-inline-size: 0;
  }
  @container (min-width: 34rem) {
    .av-policy__control {
      min-inline-size: 16rem;
    }
  }
  .av-policy__locked {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    padding: var(--av-space-1-5) var(--av-space-3);
    border: 1px dashed var(--av-border-default);
    border-radius: var(--av-radius-md);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
  }
  .av-policy__locked .av-icon {
    inline-size: 14px;
    block-size: 14px;
    flex: none;
  }
  .av-policy__detail {
    margin-block-start: var(--av-space-3);
  }
  /* A row the source has changed since somebody last approved it. The edge
     is the cue for a scanning eye; the "Changed" badge beside the name is the
     cue that is read aloud, so the colour never carries the meaning alone. */
  .av-policy__item[data-av-state=changed] {
    padding-inline-start: var(--av-space-3);
    border-inline-start: 3px solid var(--av-color-warning);
  }
  /* The group header: a title, a sentence, and the control that sets every
     row below it at once. `data-av-state="mixed"` is written by
     `[data-av-cascade]` when the rows disagree. */
  .av-policy-head {
    container-type: inline-size;
  }
  .av-policy-head__row {
    display: grid;
    gap: var(--av-space-3);
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }
  @container (min-width: 34rem) {
    .av-policy-head__row {
      grid-template-columns: minmax(0, 1fr) auto;
    }
  }
  .av-policy-head__status {
    margin: var(--av-space-1) 0 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-color-warning-text);
  }
}
@layer components {
  /* Diff ────────────────────────────────────────────────────────────────
     Two versions of a text, line by line: what was approved and what is
     there now. A tool description that changed, a schema that grew a field, a
     setting somebody edited.

     Each line says what it is in words as well as colour. The `+` and `-`
     markers are real text in `.av-diff__mark`, so they survive a copy, a
     print and a screen reader, and the soft fill is only the second cue.
     The block scrolls inside itself, like `.av-code`, so a long line never
     widens the page. */
  .av-diff {
    margin: 0;
    padding: var(--av-space-2) 0;
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-sunken);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-xs);
    line-height: var(--av-line-height-relaxed);
    direction: ltr;
    text-align: start;
    overflow-x: auto;
    min-inline-size: 0;
  }
  .av-diff__line {
    display: flex;
    gap: var(--av-space-2);
    padding-inline: var(--av-space-3);
    white-space: pre;
    color: var(--av-text-secondary);
  }
  .av-diff__mark {
    flex: none;
    inline-size: 1ch;
    color: var(--av-text-muted);
    user-select: none;
  }
  .av-diff__line--added {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-diff__line--removed {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-diff__line--added .av-diff__mark,
  .av-diff__line--removed .av-diff__mark {
    color: inherit;
  }
}
@layer components {
  /* Plan chooser ────────────────────────────────────────────────────────
     Extends `.av-pricing-card` (components/panel) with the two states a
     billing page needs and a marketing page does not: which tier you are on
     now, and what the monthly figure becomes when you switch to annual.

     The annual price is not recomputed in JavaScript from the monthly one.
     Both figures are written into the markup as integer minor units, because
     "monthly ÷ 12 with a discount" is a pricing decision that belongs to
     whoever set the prices, not to a multiplication in the front end that
     will disagree with the invoice by a rounding cent. */
  .av-plan-grid {
    display: grid;
    gap: var(--av-space-4);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: stretch;
  }
  /* The saving note only makes sense on the annual cycle, so it is hidden by
     the group's state rather than by a class the toggle has to remember to
     add to every card. */
  .av-plan-save {
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-color-success-text);
  }
  .av-plans[data-av-state=monthly] .av-plan-save {
    display: none;
  }
  .av-plans__cycle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--av-space-3);
    flex-wrap: wrap;
    margin-block-end: var(--av-space-5);
  }
  /* Feature comparison ──────────────────────────────────────────────────
     A plain table, because that is what it is: features down the side,
     tiers across the top. The tick and cross are `<svg>` with an adjacent
     visually-hidden word, so the cell reads as "Included" rather than as
     nothing at all — an icon-only cell is silent to a screen reader and this
     table is entirely icon-only cells. */
  .av-plan-table {
    inline-size: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }
  .av-plan-table th,
  .av-plan-table td {
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
    text-align: center;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-plan-table thead th {
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    background: var(--av-surface-sunken);
    position: sticky;
    inset-block-start: 0;
  }
  .av-plan-table__feature {
    text-align: start;
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-medium);
  }
  .av-plan-table__group td {
    background: var(--av-surface-sunken);
    text-align: start;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
  }
  .av-plan-table__yes {
    color: var(--av-color-success);
  }
  .av-plan-table__no {
    color: var(--av-text-disabled);
  }
}
@layer components {
  /* Faceted filter panel ────────────────────────────────────────────────
     The rail beside a catalogue: status pills, a price ceiling, category
     checkboxes, a minimum rating.

     Each group is a real `<fieldset>` with a `<legend>`. That is not
     decoration — without it a screen reader announces eleven checkboxes with
     no idea that they are all categories, and the panel becomes a list of
     unrelated words. The legend is styled, not hidden.

     The panel is a `<form>`, so Reset is `type="reset"` and Enter submits.
     Both come free and both are wrong if you build it out of buttons. */
  .av-catalog-layout {
    display: grid;
    gap: var(--av-space-5);
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
  }
  @media (max-width: 991px) {
    .av-catalog-layout {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  /* The rail follows the reader down a long result list. It is sticky rather
     than fixed so it still scrolls when it is taller than the viewport. */
  .av-facets {
    position: sticky;
    inset-block-start: var(--av-space-4);
    display: grid;
    gap: var(--av-space-5);
    min-inline-size: 0;
  }
  .av-facets__group {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
  }
  .av-facets__legend {
    padding: 0;
    margin-block-end: var(--av-space-2-5);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
  }
  .av-facets__list {
    display: grid;
    gap: var(--av-space-2);
    max-block-size: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .av-facets__option {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    cursor: pointer;
  }
  .av-facets__option:hover {
    color: var(--av-text-primary);
  }
  .av-facets__option {
    --av-check-size: 16px;
  }
  .av-facets__option-text {
    flex: 1;
    min-inline-size: 0;
  }
  .av-facets__count {
    flex: none;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-facets__foot {
    display: flex;
    gap: var(--av-space-2);
    padding-block-start: var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-facets__foot > * {
    flex: 1;
  }
  /* Results toolbar ─────────────────────────────────────────────────────
     Count on one side, sort and view controls on the other. The count is a
     live region: filtering changes it and nothing else on screen announces
     that anything happened. */
  .av-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--av-space-3);
    margin-block-end: var(--av-space-4);
  }
  .av-results-bar__count {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  .av-results-bar__count strong {
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-results-bar__tools {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    flex-wrap: wrap;
  }
  /* Active filter chips, so what is applied is visible without reading the
     rail — and removable from where the reader noticed it. */
  .av-facet-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    margin-block-end: var(--av-space-4);
  }
  /* The row the chips sit in. Without it they were inline children of a block
     and wrapped with no gap between them. */
  .av-facets__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
  .av-facet-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
    padding: var(--av-space-1) var(--av-space-1) var(--av-space-1) var(--av-space-2-5);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
  }
  .av-facet-chip__remove {
    display: grid;
    place-items: center;
    inline-size: 18px;
    block-size: 18px;
    border: 0;
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    cursor: pointer;
  }
  .av-facet-chip__remove:hover {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-facet-chip__remove:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
}
@layer components {
  /* Storefront product card ─────────────────────────────────────────────
     Grid and list are the *same DOM* in a different container display, the
     same decision the files app already makes. Two markups would mean two tab
     orders and two reading orders for one set of products, and the view
     toggle would silently reorder the page for a screen-reader user who
     cannot see that anything changed.

     The whole card is not a link. The title is. A card-sized link swallows
     the Add-to-cart and wishlist controls inside it — nested interactive
     content is invalid, and in practice the browser resolves it by making the
     buttons unreachable. The title's ::after stretches the *hit area* over the
     card instead, which gives a pointer user the big target without taking
     the buttons away from anyone. */
  .av-product-grid {
    display: grid;
    gap: var(--av-space-4);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .av-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-raised);
    overflow: hidden;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-normal) var(--av-ease-standard), transform var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-product-card:hover {
    border-color: var(--av-border-strong);
    box-shadow: var(--av-shadow-md);
    transform: translateY(calc(var(--av-lift) * -1));
  }
  /* The ring is drawn on the card because the link that takes focus is the
     title, whose own box is only as wide as its text. */
  .av-product-card:has(a:focus-visible) {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  /* The media well holds a photograph now, and the tinted gradient stays
     underneath it rather than being replaced. That is not decoration: it is
     what the reader sees in the gap between layout and decode, and a well that
     is `--av-surface-sunken` flat grey during that gap reads as an image that
     has *failed* rather than one still arriving. The tint says the frame is
     the design either way, which is why it was worth keeping when the
     photography landed.

     The glyph fallback is gone from the cards. It survives wherever a product
     genuinely has no photograph — see `.av-product-card__media > .av-icon`. */
  .av-product-card__media {
    position: relative;
    aspect-ratio: 3/2;
    display: grid;
    place-items: center;
    background-image: linear-gradient(150deg, color-mix(in oklch, var(--av-color-primary) 8%, var(--av-surface-sunken)), var(--av-surface-sunken) 70%);
    color: var(--av-text-muted);
    overflow: hidden;
  }
  /* `grid-area: 1 / 1` rather than `position: absolute`: the image is a grid
     item in the same cell the placeholder glyph occupies, so the two cannot
     disagree about where the well is, and the well keeps its `aspect-ratio`
     box whether or not an image is present. */
  .av-product-card__media img {
    grid-area: 1/1;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  /* A slow zoom on hover is the one piece of motion a catalogue earns: it
     answers "is this card the one under my pointer?" without moving anything
     the reader is trying to read. It rides `--av-lift`, so the motion axis
     turning movement off turns this off too — a theme that says it does not
     move must not then move its largest object. */
  .av-product-card__img {
    transition: scale var(--av-duration-slow) var(--av-ease-standard);
  }
  .av-product-card:hover .av-product-card__img {
    scale: calc(1 + var(--av-lift) * 0.006);
  }
  .av-product-card__media > .av-icon {
    grid-area: 1/1;
    inline-size: var(--av-space-10);
    block-size: var(--av-space-10);
  }
  .av-product-card__flags {
    position: absolute;
    inset-block-start: var(--av-space-2);
    inset-inline-start: var(--av-space-2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--av-space-1);
  }
  /* Quick actions ride the media. They are revealed on hover *and* on
     focus-within, so a keyboard user tabbing through the grid can see the
     control that has focus rather than operating an invisible button. */
  .av-product-card__quick {
    position: absolute;
    inset-block-start: var(--av-space-2);
    inset-inline-end: var(--av-space-2);
    /* `.av-product-card__media` sits *before* `.av-product-card__body` in the
       DOM, and two positioned elements at the same (auto) stack level paint
       in DOM order — later wins. The title's stretched `::after` is the
       later one, so without an explicit z-index it silently painted over
       the heart and swallowed every pointer click aimed at it, even though
       the button was visibly on top. `position: relative` alone (below,
       on `.av-product-card__foot .av-btn`) is enough for the footer, which
       already comes after the title in the DOM; the media well needs to
       actually outrank it. */
    z-index: var(--av-z-raised);
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1);
    opacity: 0;
    transform: translateX(var(--av-quick-shift, 8px));
    transition: opacity var(--av-duration-fast) var(--av-ease-standard), transform var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-product-card:hover .av-product-card__quick,
  .av-product-card:focus-within .av-product-card__quick {
    opacity: 1;
    transform: none;
  }
  /* `transform` has no logical form, so the direction is carried as a custom
     property the [dir] rule flips — the tactic this codebase already uses for
     the sidebar sweep and the auth panel. */
  [dir=rtl] .av-product-card__quick {
    --av-quick-shift: -8px;
  }
  /* On the wishlist page the heart is the row's whole point, not a hover
     discovery -- forcing it visible is what keeps it reachable on a touch
     device, which never fires :hover at all. */
  [data-av-wishlist] .av-product-card__quick {
    opacity: 1;
    transform: none;
  }
  /* And that last clause is true of every catalogue too. A control revealed
     only by :hover is a control a phone can never reach — the pointer event
     that would show it is the same tap that would have pressed it, so the
     first tap reveals and the second acts on a button that was invisible when
     the finger started moving. Where the device has no hover at all, the
     quick actions are simply present. */
  @media (hover: none) {
    .av-product-card__quick {
      opacity: 1;
      transform: none;
    }
  }
  /* Pressed means saved. Without this the heart toggles `aria-pressed` and
     paints nothing different -- the same "reports success, changes nothing"
     defect already caught in the gallery view switcher and the busy-button
     spinner. Unscoped to `.av-product-card`, because the buy box's own
     "Save" button carries the same hook and wants the same fill. */
  [data-av-favourite][aria-pressed=true] {
    color: var(--av-color-danger);
  }
  [data-av-favourite][aria-pressed=true] .av-icon {
    fill: currentColor;
  }
  /* 0-3-0 on purpose. The rule above is 0-2-0 and so is `.av-btn--on-media:hover`
     in `_button.scss`, so at equal specificity the winner would be decided by
     `@use` order — the coin flip this stylesheet has already lost three times.
     A saved heart must stay red under the pointer; that is not a tie to leave
     to file order. */
  [data-av-favourite][aria-pressed=true]:hover {
    color: var(--av-color-danger-hover);
  }
  /* Three rows, not four. The card used to stack brand, title, rating and
     price, and at 220px wide that is a form: every line is a field, none of
     them is louder than the next, and the grid runs 40% taller than it needs
     to. The brand and the rating share the top row — they are both *about*
     the product rather than the product — which leaves the name and the price
     as the only two things holding a line of their own. */
  .av-product-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1);
    padding: var(--av-space-2-5) var(--av-space-3);
    min-inline-size: 0;
  }
  .av-product-card__eyebrow {
    font-size: var(--av-font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--av-text-muted);
  }
  .av-product-card__title {
    margin: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-product-card__title a {
    color: inherit;
    text-decoration: none;
  }
  .av-product-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
  }
  .av-product-card__title a:hover {
    color: var(--av-color-primary-text);
  }
  .av-product-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    min-inline-size: 0;
  }
  .av-product-card__meta .av-product-card__eyebrow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* The rating star is filled, where every other icon in the system is a
     1.75px stroke. A 12px outlined star at the end of a pill is a small
     tangle of lines; filled, it is a star. This is the one place the icon
     rule bends, and it bends inside a single component. */
  .av-product-card__meta .av-icon {
    fill: currentColor;
    stroke: none;
  }
  .av-product-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-2);
    margin-block-start: auto;
    padding-block-start: var(--av-space-1-5);
  }
  /* Anything the reader must be able to click has to sit above the title's
     stretched hit area. */
  .av-product-card__foot .av-btn,
  .av-product-card__quick .av-btn {
    position: relative;
  }
  /* List view ───────────────────────────────────────────────────────────
     Same markup, different container. The media becomes a fixed-width
     thumbnail and the body runs alongside it. */
  .av-product-grid--list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--av-space-3);
  }
  .av-product-grid--list .av-product-card {
    flex-direction: row;
    align-items: center;
  }
  .av-product-grid--list .av-product-card__media {
    flex: none;
    inline-size: 104px;
    aspect-ratio: 1;
    border-radius: var(--av-radius-lg);
    margin: var(--av-space-3);
  }
  .av-product-grid--list .av-product-card__body {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--av-space-2) var(--av-space-4);
  }
  .av-product-grid--list .av-product-card__title {
    flex: 1;
    min-inline-size: 12ch;
  }
  .av-product-grid--list .av-product-card__foot {
    margin: 0;
    padding: 0;
    flex: none;
  }
  /* Quick actions are a grid-view affordance; in list view every control is
     already on the row. */
  .av-product-grid--list .av-product-card__quick {
    display: none;
  }
  /* Category / brand tile — the row of shortcuts above a storefront.

     It was a *column*: a 48px disc stacked over a word, in a card padded to
     roughly 100px tall. Six of them ran the full width of the page and carried
     six words between them — the emptiest band on the storefront, and the one
     a reader meets first. Laid out as a row the same tile is 44px tall, so the
     shortcuts stop out-ranking the products underneath them, and the space the
     stacking wasted now holds a count, which is the thing a shopper actually
     wants from a brand link. */
  .av-tile-row {
    display: grid;
    gap: var(--av-space-2);
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }
  .av-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--av-space-2-5);
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    text-decoration: none;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), transform var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-tile:hover {
    border-color: var(--av-color-primary);
    transform: translateY(calc(var(--av-lift) * -1));
  }
  .av-tile:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  .av-tile__art {
    flex: none;
    inline-size: 32px;
    block-size: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    color: var(--av-text-secondary);
  }
  .av-tile__art .av-icon {
    inline-size: var(--av-space-4);
    block-size: var(--av-space-4);
  }
  /* The name and the count are one flex item so the count sits under the name
     rather than being pushed to the far edge by `justify-content`, which at
     168px wide leaves a gulf between a short brand and its number. */
  .av-tile__text {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
    line-height: var(--av-line-height-tight);
  }
  .av-tile__count {
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-muted);
  }
}
@layer components {
  /* Buy box ─────────────────────────────────────────────────────────────
     The purchase column on a storefront product page: price, variant
     pickers, quantity, the primary action, and the trust row underneath it.

     It sticks to the top of the scroll container on desktop, because the
     gallery and the specification tabs beside it are far taller than it is
     and the reader should never have to scroll back up to buy. Below the
     split breakpoint it stops sticking: on a narrow screen it is already the
     next thing after the gallery, and a sticky block on a short viewport eats
     the content instead of following it. */
  .av-buy {
    display: grid;
    gap: var(--av-space-4);
    align-content: start;
  }
  @media (min-width: 992px) {
    .av-buy {
      position: sticky;
      inset-block-start: var(--av-space-4);
    }
  }
  .av-buy__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--av-space-2-5);
  }
  .av-buy__amount {
    font-size: var(--av-font-size-3xl);
    font-weight: var(--av-font-weight-bold);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
    line-height: 1.1;
  }
  .av-buy__was {
    font-size: var(--av-font-size-base);
    color: var(--av-text-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-buy__note {
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* A row inside the stacked column: a control or a badge with its note
     beside it, wrapping onto a second line when the column is narrow. The
     grid above owns the space *between* rows; this owns the space *within*
     one, which is why it is a smaller step than `.av-buy`'s gap.

     It had been written out four times inline — twice on the product page
     and twice in the quick-view drawer, which are the same buy box rendered
     at two widths. Four copies of one rule is a rule, and the two screens
     could have drifted apart at any time without a gate noticing. */
  .av-buy__row {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    flex-wrap: wrap;
  }
  .av-buy__actions {
    display: flex;
    gap: var(--av-space-2);
    flex-wrap: wrap;
  }
  .av-buy__actions > .av-btn {
    flex: 1;
    min-inline-size: 10ch;
  }
  /* Trust row — delivery, returns, warranty. Three facts a buyer looks for
     and would otherwise hunt through the tabs to find. */
  .av-buy__assurances {
    display: grid;
    gap: var(--av-space-3);
    margin: 0;
    padding: var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
    list-style: none;
  }
  /* The same three facts, laid across a card that already supplies the panel.
     The buy box stacks them in a sunken box because it is a narrow column with
     no chrome of its own; a full-width card has both, so a second border and a
     second ground read as a box inside a box. The store's home page had been
     switching all four declarations off inline, which is a modifier written in
     the one place no gate can see it. */
  .av-buy__assurances--bare {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 0;
    border: 0;
    background: transparent;
  }
  .av-buy__assurance {
    display: flex;
    gap: var(--av-space-2-5);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
  }
  .av-buy__assurance svg {
    flex: none;
    color: var(--av-text-muted);
  }
  .av-buy__assurance strong {
    display: block;
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-medium);
  }
  /* The quantity stepper is `components/_cart.scss`'s `.av-qty`, reused
     verbatim rather than restyled here. It is the same control doing the same
     job, and a second definition of the class would land in the same layer at
     the same specificity — decided by `@use` order, which is how the Orders
     toolbar was silently resized once already. `lint-css.mjs` fails on that
     now.

     Its `type="text"` plus `inputmode="numeric"` is deliberate and worth
     inheriting: a `type="number"` field edits itself when the wheel scrolls
     over it, which on a buy box changes the quantity of an order without
     anybody touching it. */
}
@layer components {
  /* Storefront promotion panel ──────────────────────────────────────────
     This component used to live in `components/_buy-box.scss`, named after the
     screen that happened to need it first — the same misfiling that put
     `.av-section` in `_example.scss` and `.av-avatar` in the topbar partial.
     A promo is not a buy box; it appears above one.

     Every size and layout decision below arrived as an inline `style=` on the
     shop home page: `min-block-size: 260px`, `font-size: var(--av-font-size-2xl)`,
     `align-self: flex-start`, `display: grid`. Inline styles are invisible to
     `lint-css.mjs` — they are outside every `@layer`, they answer to no
     specificity ceiling, and the tokens-only rule cannot see them. A design
     system that reaches for `style=` in its own demo has stopped being a design
     system on that page, so each one became a modifier here instead. */
  .av-promo {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--av-space-3);
    padding: var(--av-space-6);
    border-radius: var(--av-radius-2xl);
    background: var(--av-color-primary-subtle);
    border: 1px solid var(--av-color-primary-border);
    min-block-size: 200px;
    overflow: hidden;
  }
  .av-promo--accent {
    background: var(--av-surface-accent-subtle);
    border-color: var(--av-border-subtle);
  }
  .av-promo--success {
    background: var(--av-color-success-subtle);
    border-color: var(--av-color-success-border);
  }
  /* A badge is a flex item in a column, so without this it stretches the full
     width of the panel and reads as a banner rather than a tag. It was an
     inline `align-self` on every instance. */
  .av-promo > .av-badge,
  .av-promo__body > .av-badge {
    align-self: flex-start;
  }
  .av-promo__title {
    margin: 0;
    font-size: var(--av-font-size-xl);
    font-weight: var(--av-font-weight-bold);
    color: var(--av-text-primary);
  }
  .av-promo__text {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    max-inline-size: 40ch;
  }
  .av-promo__foot {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    flex-wrap: wrap;
    margin-block-start: var(--av-space-1);
  }
  /* Two sizes rather than a per-instance `min-block-size` and `font-size`. The
     type scale steps with the panel because a 2xl heading inside a 120px-tall
     card is the reason the small offers looked mis-set. */
  .av-promo--lg {
    min-block-size: 260px;
  }
  .av-promo--lg .av-promo__title {
    font-size: var(--av-font-size-2xl);
  }
  .av-promo--sm {
    min-block-size: 0;
    padding: var(--av-space-5);
  }
  .av-promo--sm .av-promo__title {
    font-size: var(--av-font-size-lg);
  }
  /* `--media` turns the panel into a row holding a real photograph. The
     padding moves off the panel and onto `__body`, because a photo that stops
     short of the panel edge reads as a mistake rather than as a margin — the
     image has to bleed to the corner radius, which is what `overflow: hidden`
     on the panel is already there to do. */
  .av-promo--media {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }
  .av-promo__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--av-space-3);
    padding: var(--av-space-6);
    min-inline-size: 0;
  }
  .av-promo--sm .av-promo__body {
    padding: var(--av-space-5);
  }
  .av-promo__media {
    flex: 0 0 38%;
    position: relative;
    overflow: hidden;
  }
  .av-promo--sm .av-promo__media {
    flex-basis: 34%;
  }
  .av-promo__media img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  /* Below the panel's own breakpoint the photo would be a sliver, so the row
     becomes a stack and the image takes a fixed band. Reading order is
     unchanged: the body is first in the DOM either way. */
  @media (max-width: 700px) {
    .av-promo--media {
      flex-direction: column;
    }
    .av-promo__media {
      flex: 0 0 160px;
      order: -1;
    }
  }
  /* The decorative glyph the photograph replaced. It stays for a promotion
     that has no product behind it — a sale banner, a shipping offer — where
     there is nothing to photograph. */
  .av-promo__art {
    position: absolute;
    inset-block-end: calc(var(--av-space-4) * -1);
    inset-inline-end: calc(var(--av-space-4) * -1);
    color: var(--av-color-primary);
    opacity: 0.18;
    pointer-events: none;
  }
  /* The column that stacks two small promos beside one large one. It was
     `style="display: grid; gap: var(--av-space-4)"` on a bare `<div>`. */
  .av-promo-stack {
    display: grid;
    gap: var(--av-space-4);
    align-content: start;
  }
}
@layer components {
  /* Storefront hero ─────────────────────────────────────────────────────
     What stood here was a search field centred in a tinted card: roughly 130px
     of empty ground in the first screenful, which is the most expensive space
     on the page. The field itself was worth keeping — it is how people who
     know what they want start — but a search box is a *tool*, and a shop's
     first screen has to say what it sells before it offers to filter it.

     The photograph is the copy's other half rather than a backdrop behind it.
     Text over a photo needs a scrim, a contrast measurement per preset and a
     fallback for the moment before the image decodes; text *beside* one needs
     none of those, and `tests/contrast.mjs` can go on measuring the heading
     against a token it actually resolves against. */
  .av-store-hero {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: var(--av-radius-2xl);
    border: 1px solid var(--av-border-subtle);
    background-image: var(--av-gradient-brand-soft);
    overflow: hidden;
  }
  .av-store-hero__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--av-space-3);
    padding: var(--av-space-8) var(--av-space-7);
    min-inline-size: 0;
  }
  .av-store-hero__title {
    margin: 0;
    font-size: var(--av-font-size-3xl);
    line-height: var(--av-line-height-tight);
    font-weight: var(--av-font-weight-bold);
    color: var(--av-text-primary);
    max-inline-size: 22ch;
  }
  .av-store-hero__text {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    max-inline-size: 48ch;
  }
  /* The search form keeps its own measure rather than filling the column: a
     560px field under a 22ch heading is already wider than the thing it sits
     beneath, and any wider reads as a page-width input that has lost its box. */
  .av-store-hero__search {
    inline-size: min(460px, 100%);
    margin: 0;
    margin-block-start: var(--av-space-2);
  }
  .av-store-hero__media {
    flex: 0 0 42%;
    position: relative;
    overflow: hidden;
  }
  .av-store-hero__media img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  /* The photograph is joined to the copy by a wash of the panel's own ground
     rather than by a hard edge. `--av-hero-fade` carries the direction because
     a gradient has no logical keyword — the same tactic the sidebar sweep and
     the auth panel already use. */
  .av-store-hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--av-hero-fade, 90deg), var(--av-surface-raised), transparent 38%);
  }
  [dir=rtl] .av-store-hero__media {
    --av-hero-fade: 270deg;
  }
  @media (max-width: 860px) {
    .av-store-hero {
      flex-direction: column;
    }
    .av-store-hero__media {
      flex: 0 0 180px;
      order: -1;
    }
    .av-store-hero__media::after {
      background-image: none;
    }
    .av-store-hero__body {
      padding: var(--av-space-6) var(--av-space-5);
    }
    .av-store-hero__title {
      font-size: var(--av-font-size-2xl);
    }
  }
}
@layer components {
  /* Settings ────────────────────────────────────────────────────────── */
  .av-settings {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--av-space-6);
    align-items: start;
  }
  @media (max-width: 991.98px) {
    .av-settings {
      grid-template-columns: 1fr;
      gap: var(--av-space-4);
    }
  }
  .av-settings__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    inset-block-start: 0;
  }
  @media (max-width: 991.98px) {
    .av-settings__nav {
      position: static;
      flex-direction: row;
      overflow-x: auto;
      padding-block-end: var(--av-space-2);
    }
  }
  .av-settings__tab {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    min-block-size: 40px;
    padding-inline: var(--av-space-3);
    border: 0;
    border-radius: var(--av-radius-md);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    text-align: start;
    white-space: nowrap;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-settings__tab:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-settings__tab[aria-selected=true] {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-settings__panel {
    animation: av-panel-in var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-settings__panel[hidden] {
    display: none;
  }
  @keyframes av-panel-in {
    from {
      opacity: 0;
      translate: 0 6px;
    }
  }
  .av-settings__identity {
    display: flex;
    align-items: center;
    gap: var(--av-space-4);
    padding-block-end: var(--av-space-5);
    margin-block-end: var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-settings__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--av-space-4);
  }
  @media (max-width: 575.98px) {
    .av-settings__row {
      grid-template-columns: 1fr;
    }
    .av-settings__identity {
      flex-direction: column;
      align-items: flex-start;
    }
  }
}
@layer components {
  /* Option list (a labelled control per row) ────────────────────────── */
  .av-option-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-4);
    padding-block: var(--av-space-4);
  }
  .av-option + .av-option {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-option:first-child {
    padding-block-start: 0;
  }
  .av-option:last-child {
    padding-block-end: 0;
  }
  /* A single `.av-option` used ahead of unrelated content in the same card
     (a toggle row above a set of fields, say) rather than inside an
     `.av-option-list` — the sibling-border rule above has nothing to draw
     against, so this draws the same rule against whatever follows it. */
  .av-option--section {
    padding-block-end: var(--av-space-4);
    margin-block-end: var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  /* The icon and the title/text block move together, as one unit, leaving
     `.av-option` itself to place only two things: that unit and the control. */
  .av-option__body {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    min-inline-size: 0;
  }
  .av-option__title {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    margin: 0;
  }
  .av-option__text {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin: 2px 0 0;
  }
  /* A leading icon chip, the same tinted-tile recipe `.av-stat-card__icon`
     uses, at row rather than card scale. Optional — a row with nothing
     distinctive to lead with is still a valid `.av-option`. */
  .av-option__icon {
    display: grid;
    place-items: center;
    flex: none;
    inline-size: 36px;
    block-size: 36px;
    border-radius: var(--av-radius-md);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-option__icon .av-icon {
    inline-size: 18px;
    block-size: 18px;
  }
  .av-option__icon--success {
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-option__icon--warning {
    background: var(--av-color-warning-subtle);
    color: var(--av-color-warning-text);
  }
  .av-option__icon--danger {
    background: var(--av-color-danger-subtle);
    color: var(--av-color-danger-text);
  }
  .av-option__icon--info {
    background: var(--av-color-info-subtle);
    color: var(--av-color-info-text);
  }
  /* `.av-select`'s own `inline-size: 100%` is right inside a `.av-field` and
     wrong as a row's trailing control — resolved against the row's full
     width, it would run straight into `.av-option__body`. A row's control
     stays sized to its own content, same as the switch and badge it sits
     beside. */
  .av-option > .av-select {
    inline-size: auto;
    min-inline-size: 160px;
    flex: none;
  }
  /* The list as the whole of a card body rather than a block inside one: it
     supplies the padding the body would otherwise have to, so the rows can run
     edge to edge under a divider. */
  .av-option-list--inset {
    padding: var(--av-space-4) var(--av-card-padding);
  }
}
@layer components {
  /* ══ CHIP / TAG ═════════════════════════════════════════════════════
     One component, and it was two: `components/_kanban.scss` and
     `components/_mail.scss` each declared `.av-chip` at 0-1-0 in the same
     layer, so what any chip in this product actually looked like was decided
     by `@use` order — and the result was neither of them. Equal specificity in
     one layer resolves per *property*, so mail (used later) won `font-weight`,
     `padding`, `border-radius` and `background`, while kanban kept the two
     properties mail never mentioned: `min-block-size` and `letter-spacing`.
     Every chip on the four pages that carry one has been rendering as a merge
     of two components nobody designed, and each partial looked correct on its
     own — which is the whole argument for the duplicate-class rule that
     `lint-css.mjs` now enforces.

     The base is the tag: outlined, neutral, quiet. `docs/06-components/`
     `07-data-display.md` specifies it that way, and three of the four callers
     (mail, notes, the UI-kit page) already assume it. */
  .av-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1);
    min-block-size: 18px;
    padding: 2px var(--av-space-2);
    border-radius: var(--av-radius-sm);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-medium);
    white-space: nowrap;
  }
  /* The dense variant: a label on a card, where a row of tags competes with
     the title above it. `docs/08-pages/02-applications.md` documented
     `.av-chip--sm` on a kanban card before anything implemented it, so this
     closes the gap in the direction this repository prefers — the
     implementation moves to the contract, not the contract to the build. */
  .av-chip--sm {
    min-block-size: 16px;
    padding: 1px var(--av-space-1-5);
    border-radius: var(--av-radius-xs);
  }
  /* A label on a kanban card carries a *role*, not a subject. The modifiers
     here were `--design`, `--bug`, `--content`, `--research` and `--infra`:
     five names from one board's domain, in a component partial, which is the
     `.av-section`-in-`_example.scss` mistake in its other direction — a
     component knowing about its first caller's content. The board maps its own
     subjects onto the roles now, and the roles come from the one `$status`
     list, so a new role reaches every component that has one rather than four
     of the five. */
  .av-chip--primary {
    background: var(--av-color-primary-subtle);
    border: 1px solid var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  .av-chip--success {
    background: var(--av-color-success-subtle);
    border: 1px solid var(--av-color-success-border);
    color: var(--av-color-success-text);
  }
  .av-chip--warning {
    background: var(--av-color-warning-subtle);
    border: 1px solid var(--av-color-warning-border);
    color: var(--av-color-warning-text);
  }
  .av-chip--danger {
    background: var(--av-color-danger-subtle);
    border: 1px solid var(--av-color-danger-border);
    color: var(--av-color-danger-text);
  }
  .av-chip--info {
    background: var(--av-color-info-subtle);
    border: 1px solid var(--av-color-info-border);
    color: var(--av-color-info-text);
  }
  .av-chip--neutral {
    background: var(--av-color-neutral-subtle);
    border: 1px solid var(--av-color-neutral-border);
    color: var(--av-color-neutral-text);
  }
}
@layer components {
  /* ══ FAQ ════════════════════════════════════════════════════════════
     A list of questions, each one a disclosure. The behaviour is
     `[data-av-collapse]` — the same pairing of `aria-expanded` and
     `aria-controls` every other disclosure in this product uses — so there is
     no FAQ module, and a question that opens without the attribute changing
     would be a picture of an accordion rather than one.

     One card holding rows, rather than a card per question: a page of
     twenty-odd cards reads as twenty-odd things to decide between, when it is
     one list to scan. */
  .av-faq {
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
    overflow: hidden;
  }
  .av-faq__item + .av-faq__item {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-faq__item[hidden] {
    display: none;
  }
  .av-faq__q {
    inline-size: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-4);
    padding: var(--av-space-4) var(--av-space-5);
    border: 0;
    background: none;
    color: var(--av-text-primary);
    font-family: inherit;
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-medium);
    text-align: start;
    transition: background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-faq__q:hover {
    background: var(--av-surface-sunken);
  }
  .av-faq__a {
    padding: 0 var(--av-space-5) var(--av-space-5);
    color: var(--av-text-secondary);
    max-inline-size: 68ch;
  }
  .av-faq__a > :first-child {
    margin-block-start: 0;
  }
  .av-faq__a > :last-child {
    margin-block-end: 0;
  }
  /* The topic heading a filter can hide along with the rows under it. It is a
     `[data-av-notif-group]`, which is what `initNotifFilters` walks — the same
     module the notifications drawer and the audit log use. A third page
     needing "chips over a grouped list" is what tells you the module was worth
     generalising rather than forking. */
  .av-faq__topic {
    padding: var(--av-space-3) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wide);
    text-transform: uppercase;
    color: var(--av-text-muted);
    margin: 0;
  }
  .av-faq__topic:first-child {
    border-block-start: 0;
  }
  .av-faq__topic[hidden] {
    display: none;
  }
}
@layer components {
  /* ══ THUMB ══════════════════════════════════════════════════════════
     One 1:1 media well, and it was three: `.av-cart-line__thumb`,
     `.av-summary__thumb` and `.av-line-item__thumb`, in `_cart.scss`,
     `_checkout.scss` and `_order.scss`. They were not near-identical by
     accident — the second and third are the same eleven declarations with one
     number different, and the comment explaining why the well is
     `place-items: center` had been copied verbatim into both. Three copies of
     one component is three places to fix the next thing found in it, and the
     product-page gallery has already shown what that costs.

     The size is a custom property because the well and whatever track holds it
     must not disagree: `_cart.scss` already learned that when the drawer set
     48px on the element while its grid track stayed 64px, and the gap that
     opened up had no visible source. Set `--av-thumb-size` on the container —
     and note that the default lives in the `var()` fallback rather than as a
     declaration on `.av-thumb` itself. A declaration on the element would beat
     the value inherited from the container, so every caller would have to set
     the property twice or not at all. */
  .av-thumb {
    position: relative;
    overflow: hidden;
    inline-size: var(--av-thumb-size, 40px);
    block-size: var(--av-thumb-size, 40px);
    flex: none;
    border-radius: var(--av-radius-md);
    display: grid;
    place-items: center;
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    color: var(--av-text-muted);
  }
  /* The well is `place-items: center` for the glyph fallback — a line with no
     photograph shows an icon — so an image has to claim the whole box or it
     sits centred at its intrinsic size inside it. `overflow: hidden` because
     the well is the thing carrying the radius, not the image. */
  .av-thumb img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
}
@layer components {
  .av-kanban {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 1fr);
    gap: var(--av-space-4);
    align-items: start;
    overflow-x: auto;
    padding-block-end: var(--av-space-2);
    scrollbar-width: thin;
  }
  @media (max-width: 767.98px) {
    .av-kanban {
      grid-auto-columns: minmax(260px, 85vw);
    }
  }
  .av-kanban__column {
    display: flex;
    flex-direction: column;
    max-block-size: 100%;
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
  }
  .av-kanban__header {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-4) var(--av-space-4) var(--av-space-3);
  }
  /* The add button is sized by the column head it sits in, not by the button
     scale: four of them carried the same height inline, which is a rule. */
  .av-kanban__header .av-btn--icon {
    --av-btn-height: var(--av-control-xs);
  }
  .av-kanban__title {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    flex: 1;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  .av-kanban__count {
    display: inline-grid;
    place-items: center;
    min-inline-size: 20px;
    block-size: 20px;
    padding-inline: var(--av-space-1-5);
    border-radius: var(--av-radius-full);
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  .av-kanban__dot {
    inline-size: 8px;
    block-size: 8px;
    flex: none;
    border-radius: var(--av-radius-full);
    background: var(--av-kanban-accent, var(--av-color-primary));
  }
  .av-kanban__column--todo {
    --av-kanban-accent: var(--av-color-neutral);
  }
  .av-kanban__column--progress {
    --av-kanban-accent: var(--av-color-info);
  }
  .av-kanban__column--review {
    --av-kanban-accent: var(--av-color-warning);
  }
  .av-kanban__column--done {
    --av-kanban-accent: var(--av-color-success);
  }
  .av-kanban__list {
    list-style: none;
    margin: 0;
    padding: 0 var(--av-space-3) var(--av-space-3);
    display: flex;
    flex-direction: column;
    gap: var(--av-space-2);
    min-block-size: 60px;
    overflow-y: auto;
  }
  .av-kanban__card {
    padding: var(--av-space-3-5, var(--av-space-3));
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    box-shadow: var(--av-shadow-xs);
    cursor: grab;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-kanban__card:hover {
    border-color: var(--av-border-default);
    box-shadow: var(--av-shadow-sm);
  }
  .av-kanban__card:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: 2px;
  }
  .av-kanban__card.is-picked {
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 2px var(--av-color-primary), var(--av-shadow-lg);
    cursor: grabbing;
  }
  .av-kanban__card.av-sortable-ghost {
    opacity: 0.4;
    border-style: dashed;
  }
  .av-kanban__card.av-sortable-drag {
    cursor: grabbing;
    box-shadow: var(--av-shadow-xl);
  }
  .av-kanban__labels {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-1-5);
    margin-block-end: var(--av-space-2);
  }
  .av-kanban__card-title {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    line-height: var(--av-line-height-snug);
    margin: 0;
    color: var(--av-text-primary);
  }
  .av-kanban__card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-3);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-kanban__meta {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
  }
  .av-kanban__meta .av-icon {
    inline-size: 14px;
    block-size: 14px;
  }
  .av-kanban__add {
    margin: 0 var(--av-space-3) var(--av-space-3);
    min-block-size: 36px;
    border: 1px dashed var(--av-border-default);
    border-radius: var(--av-radius-md);
    background: none;
    color: var(--av-text-muted);
    font-size: var(--av-font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--av-space-2);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-kanban__add:hover {
    border-color: var(--av-color-primary);
    color: var(--av-color-primary-text);
  }
  .av-kanban__empty {
    padding: var(--av-space-4);
    border: 1px dashed var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    text-align: center;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-kanban__empty[hidden] {
    display: none;
  }
  .av-kanban__hint {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    margin-block-end: var(--av-space-4);
    padding: var(--av-space-2-5) var(--av-space-4);
    border: 1px solid var(--av-color-info-border);
    border-radius: var(--av-radius-md);
    background: var(--av-color-info-subtle);
    color: var(--av-color-info-text);
    font-size: var(--av-font-size-xs);
  }
}
@layer components {
  /* Timeline ────────────────────────────────────────────────────────────
     An ordered list of events, newest first. The connecting rail is drawn on
     the item (not a pseudo-element on the list) so it stops cleanly at the last
     marker without needing to know how many items there are. */
  .av-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: var(--av-space-3);
    padding-block-end: var(--av-space-5);
  }
  .av-timeline__item:last-child {
    padding-block-end: 0;
  }
  /* The rail: from just under this marker to the top of the next one. */
  .av-timeline__item:not(:last-child)::before {
    content: "";
    position: absolute;
    inset-block: 30px 0;
    inset-inline-start: 13px;
    inline-size: 2px;
    border-radius: var(--av-radius-full);
    background: var(--av-border-subtle);
  }
  .av-timeline__marker {
    inline-size: 28px;
    block-size: 28px;
    border-radius: var(--av-radius-full);
    display: grid;
    place-items: center;
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    color: var(--av-text-muted);
  }
  .av-timeline__marker .av-icon {
    inline-size: 15px;
    block-size: 15px;
  }
  .av-timeline__item--primary > .av-timeline__marker {
    background: var(--av-color-primary-subtle);
    border: 1px solid var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  .av-timeline__item--success > .av-timeline__marker {
    background: var(--av-color-success-subtle);
    border: 1px solid var(--av-color-success-border);
    color: var(--av-color-success-text);
  }
  .av-timeline__item--warning > .av-timeline__marker {
    background: var(--av-color-warning-subtle);
    border: 1px solid var(--av-color-warning-border);
    color: var(--av-color-warning-text);
  }
  .av-timeline__item--danger > .av-timeline__marker {
    background: var(--av-color-danger-subtle);
    border: 1px solid var(--av-color-danger-border);
    color: var(--av-color-danger-text);
  }
  .av-timeline__item--info > .av-timeline__marker {
    background: var(--av-color-info-subtle);
    border: 1px solid var(--av-color-info-border);
    color: var(--av-color-info-text);
  }
  .av-timeline__item--neutral > .av-timeline__marker {
    background: var(--av-color-neutral-subtle);
    border: 1px solid var(--av-color-neutral-border);
    color: var(--av-color-neutral-text);
  }
  .av-timeline__body {
    min-inline-size: 0;
  }
  .av-timeline__title {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    /* The base heading rule sets its own colour; timeline titles are sometimes
       headings and must keep the colour above. */
    margin: 0;
  }
  .av-timeline__text {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    margin-block: var(--av-space-1) 0;
  }
  .av-timeline__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: var(--av-space-1);
  }
  .av-timeline__meta > * + *::before {
    content: "·";
    margin-inline-end: var(--av-space-2);
  }
  /* A freshly added entry gets one gentle highlight so the change is visible
     to someone who was looking elsewhere on the page when it happened. */
  .av-timeline__item.is-new > .av-timeline__body {
    animation: av-timeline-in var(--av-duration-slow) var(--av-ease-standard);
  }
  @keyframes av-timeline-in {
    from {
      opacity: 0;
      translate: 0 -6px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .av-timeline__item.is-new > .av-timeline__body {
      animation: none;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-timeline__item.is-new > .av-timeline__body {
    animation: none;
  }
}
@layer components {
  /* Detail list ─────────────────────────────────────────────────────────
     A <dl> of label/value pairs. Each pair is wrapped in a <div> — the only
     way to make dt/dd a grid row without losing the definition-list semantics
     screen readers announce. */
  .av-detail-list {
    margin: 0;
    display: grid;
    gap: var(--av-space-2-5);
    font-size: var(--av-font-size-sm);
  }
  .av-detail-list > div {
    display: grid;
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr);
    gap: var(--av-space-3);
    align-items: baseline;
  }
  .av-detail-list dt {
    color: var(--av-text-muted);
    font-weight: var(--av-font-weight-normal);
  }
  .av-detail-list dd {
    margin: 0;
    color: var(--av-text-primary);
    overflow-wrap: anywhere;
  }
  .av-detail-list dd a {
    color: var(--av-color-primary-text);
  }
  /* Stacked: for narrow side panels where 7rem of label leaves no room left. */
  .av-detail-list--stacked > div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .av-detail-list--stacked dt {
    font-size: var(--av-font-size-xs);
  }
  @media (max-width: 575.98px) {
    .av-detail-list > div {
      grid-template-columns: 1fr;
      gap: 0;
    }
  }
  .av-address {
    margin: 0;
    font-style: normal;
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-relaxed);
    color: var(--av-text-secondary);
  }
  /* A URL as a value: small, and allowed to break anywhere. A long endpoint
     has no spaces and no hyphens, so without `anywhere` it sets the row's
     minimum width to its own and pushes the definition list past the card. */
  .av-detail-list__url {
    font-size: var(--av-font-size-xs);
    overflow-wrap: anywhere;
  }
}
@layer components {
  /* Steps ───────────────────────────────────────────────────────────────
     A linear pipeline: order fulfilment here, checkout later. State is carried
     by `data-av-state` (done | current | todo) rather than an is-* class,
     because the values are enumerated and mutually exclusive. */
  .av-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--av-space-2);
    counter-reset: av-step;
  }
  .av-steps__item {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    min-inline-size: 0;
  }
  /* The connector is a flex item that takes whatever space the label leaves,
     so it actually reaches the next marker. An absolutely positioned stub
     sized in pixels cannot: the gap between two steps depends on how long the
     labels are, which CSS only knows at layout time. Drawn on the item rather
     than the list so the last step never trails a line into empty space. */
  .av-steps__item:not(:last-child)::after {
    content: "";
    flex: 1 1 auto;
    min-inline-size: var(--av-space-4);
    block-size: 2px;
    background: var(--av-border-subtle);
    border-radius: var(--av-radius-full);
  }
  .av-steps__item[data-av-state=done]:not(:last-child)::after {
    background: var(--av-color-primary);
  }
  .av-steps__marker {
    inline-size: 26px;
    block-size: 26px;
    flex: none;
    border-radius: var(--av-radius-full);
    display: grid;
    place-items: center;
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    color: var(--av-text-muted);
    transition: background-color var(--av-duration-normal) var(--av-ease-standard), color var(--av-duration-normal) var(--av-ease-standard);
  }
  .av-steps__marker .av-icon {
    inline-size: 14px;
    block-size: 14px;
  }
  .av-steps__item[data-av-state=done] .av-steps__marker {
    background: var(--av-color-primary);
    border-color: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  .av-steps__item[data-av-state=current] .av-steps__marker {
    background: var(--av-color-primary-subtle);
    border-color: var(--av-color-primary);
    color: var(--av-color-primary-text);
    box-shadow: 0 0 0 3px var(--av-color-primary-subtle);
  }
  .av-steps__label {
    flex: 0 1 auto;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-steps__item[data-av-state=current] .av-steps__label {
    color: var(--av-text-primary);
  }
  .av-steps__item[data-av-state=done] .av-steps__label {
    color: var(--av-text-secondary);
  }
  /* Below ~720px four columns of label do not fit; stack and let the connector
     go, rather than truncating every label to two characters. */
  @media (max-width: 767.98px) {
    .av-steps {
      grid-auto-flow: row;
      grid-auto-columns: auto;
      gap: var(--av-space-3);
    }
    .av-steps__item:not(:last-child)::after {
      display: none;
    }
    .av-steps__label {
      font-size: var(--av-font-size-sm);
    }
  }
}
@layer components {
  /* Line item cell ──────────────────────────────────────────────────── */
  .av-line-item {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    min-inline-size: 0;
  }
  .av-line-item__name {
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-line-item__sku {
    display: block;
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* Totals ──────────────────────────────────────────────────────────────
     <tfoot> is the semantically correct home for totals and it repeats on
     every printed page. Its cells need their own rules: the tbody selectors
     deliberately do not reach them. */
  .av-table tfoot th,
  .av-table tfoot td {
    padding: var(--av-space-2) var(--av-space-4);
    font-variant-numeric: tabular-nums lining-nums;
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-secondary);
    text-align: end;
  }
  .av-table tfoot tr:first-child th,
  .av-table tfoot tr:first-child td {
    padding-block-start: var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-table tfoot .av-table__total th,
  .av-table tfoot .av-table__total td {
    padding-block: var(--av-space-3) var(--av-space-4);
    border-block-start: 1px solid var(--av-border-strong);
    color: var(--av-text-primary);
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
  }
  /* Order header: status badge and meta beside the title ──────────────── */
  .av-order-status {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    flex-wrap: wrap;
  }
  /* "My orders" list ──────────────────────────────────────────────────
     One card per order, the lines inside — Metronic's own shape, and the
     opposite of a table where the reader has to reconstruct which rows
     belong to which order. `.av-line-item` is the same cell the admin's
     single-order table already uses; this only adds the row it sits in and
     the vertical rhythm between rows, which a *list* of orders needs and a
     single order's `<table>` did not. */
  .av-order-summary__items {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-3);
  }
  .av-order-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
  }
  .av-order-summary__item .av-line-item {
    min-inline-size: 0;
  }
  .av-note-form {
    display: grid;
    gap: var(--av-space-3);
  }
  .av-note-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--av-space-2);
  }
  .av-note-form textarea {
    inline-size: 100%;
    min-block-size: 72px;
    resize: vertical;
    padding: var(--av-space-2-5) var(--av-space-3);
    border-radius: var(--av-radius-md);
    border: 1px solid var(--av-border-default);
    background: var(--av-surface-base);
    color: var(--av-text-primary);
    font: inherit;
    font-size: var(--av-font-size-sm);
  }
  .av-note-form textarea:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 1px;
    border-color: var(--av-color-primary);
  }
}
@layer components {
  /* Wizard ──────────────────────────────────────────────────────────────
     Hidden panels stay in the DOM — they are never destroyed — so going back
     finds every field exactly as it was left. That is also why the panel is a
     <fieldset>: it groups the step's fields semantically, and its <legend>
     names the step for anyone who cannot see the progress bar. */
  .av-wizard__panel {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
  }
  /* A fieldset is `display: block` by the UA rule at the same weight as any
     author rule, so an author display here would need its own [hidden] guard.
     Set it explicitly rather than relying on that. */
  .av-wizard__panel[hidden] {
    display: none;
  }
  .av-wizard__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
    margin-block-start: var(--av-space-5);
  }
  .av-wizard__actions .av-btn:only-child {
    margin-inline-start: auto;
  }
  /* Review list on the final step: what each earlier step collected, with a
     link back to change it. */
  .av-review {
    display: grid;
    gap: var(--av-space-3);
    margin: 0;
  }
  .av-review__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-4);
    padding-block-end: var(--av-space-3);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-review__row:last-child {
    border-block-end: 0;
    padding-block-end: 0;
  }
  .av-review__label {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    flex: none;
    inline-size: 7rem;
  }
  .av-review__value {
    flex: 1;
    min-inline-size: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-primary);
    margin: 0;
  }
}
@layer components {
  /* Choice card ─────────────────────────────────────────────────────────
     A radio or checkbox with a whole card as its label. The control stays a
     real <input> in the DOM — it is what carries the name, the value, the
     keyboard arrow behaviour of a radio group, and the form submission. Only
     its appearance is ours. */
  .av-choice-group {
    display: grid;
    gap: var(--av-space-3);
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
  }
  .av-choice {
    display: flex;
    align-items: flex-start;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-base);
    cursor: pointer;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), background-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-choice:hover {
    border-color: var(--av-border-strong);
  }
  /* :has on the label rather than a sibling selector, so the highlighted region
     is the whole card no matter where the input sits inside it. */
  .av-choice:has(.av-choice__input:checked) {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
  }
  /* The input is visually replaced but never removed, so focus lands on a real
     control; the ring is drawn on the card it labels. */
  .av-choice:has(.av-choice__input:focus-visible) {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: var(--av-focus-offset);
  }
  /* Nudged down a couple of pixels so it sits on the title's cap height rather
     than on the line box, which is taller than the text in it. */
  .av-choice__input {
    --av-check-size: 18px;
    margin-block-start: 2px;
  }
  .av-choice__body {
    flex: 1;
    min-inline-size: 0;
  }
  .av-choice__title {
    display: block;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-choice__text {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
  .av-choice__meta {
    flex: none;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }
}
@layer components {
  /* Order summary ───────────────────────────────────────────────────────
     Always visible on desktop; on mobile it collapses behind a bar that still
     shows the total, because "how much is this" must never be more than one
     tap away. */
  .av-summary {
    position: sticky;
    inset-block-start: var(--av-space-4);
  }
  .av-summary__line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-4);
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-summary__line + .av-summary__line {
    margin-block-start: var(--av-space-2);
  }
  .av-summary__line span:last-child {
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-summary__line--total {
    margin-block-start: var(--av-space-3);
    padding-block-start: var(--av-space-3);
    border-block-start: 1px solid var(--av-border-strong);
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-summary__items {
    list-style: none;
    margin: 0 0 var(--av-space-4);
    padding: 0;
    display: grid;
    gap: var(--av-space-3);
  }
  .av-summary__item {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    min-inline-size: 0;
  }
  .av-summary__qty {
    position: absolute;
    inset-block-start: -7px;
    inset-inline-end: -7px;
    min-inline-size: 18px;
    block-size: 18px;
    padding-inline: 4px;
    border-radius: var(--av-radius-full);
    display: grid;
    place-items: center;
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-summary__name {
    flex: 1;
    min-inline-size: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-summary__price {
    flex: none;
    font-size: var(--av-font-size-sm);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-summary__toggle {
    display: none;
    inline-size: 100%;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    font: inherit;
    font-size: var(--av-font-size-sm);
    margin-block-end: var(--av-space-4);
  }
  .av-summary__toggle .av-icon {
    transition: rotate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-summary__toggle[aria-expanded=true] .av-icon {
    rotate: 180deg;
  }
  /* Collapse is expressed as `data-av-state`, not `hidden`, and the rule that
     acts on it lives only inside the narrow media query. Above the breakpoint
     the summary is therefore always open whatever state the toggle was left in
     — no `!important` needed to force it back, which matters because
     `!important` is only allowed in `@layer utilities`. */
  @media (max-width: 991.98px) {
    .av-summary {
      position: static;
    }
    .av-summary__toggle {
      display: flex;
    }
    .av-summary[data-av-state=collapsed] {
      display: none;
    }
  }
}
@layer components {
  /* Quantity stepper ────────────────────────────────────────────────────
     The <input> is the control; the buttons are conveniences beside it. Typing
     a quantity has to work, because "set this to 12" is faster than pressing +
     eleven times. */
  .av-qty {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    overflow: hidden;
    background: var(--av-surface-base);
  }
  .av-qty__btn {
    inline-size: 32px;
    border: 0;
    background: none;
    color: var(--av-text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
  }
  .av-qty__btn:hover:not(:disabled) {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-qty__btn:disabled {
    color: var(--av-text-disabled);
    cursor: not-allowed;
  }
  /* The stepper is 23px tall from its content alone, which is one pixel short
     of the touch minimum on the one control a buyer uses most. */
  @media (pointer: coarse) {
    .av-qty__btn, .av-qty__input {
      min-block-size: var(--av-size-touch-min);
    }
  }
  .av-qty__input {
    inline-size: 44px;
    border: 0;
    border-inline: 1px solid var(--av-border-default);
    background: none;
    color: var(--av-text-primary);
    font: inherit;
    font-size: var(--av-font-size-sm);
    text-align: center;
    font-variant-numeric: tabular-nums;
    /* type="text" + inputmode, so no spinners and no wheel-scroll edits. */
    appearance: none;
  }
  .av-qty__input:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--av-color-primary);
  }
  /* Cart line ───────────────────────────────────────────────────────── */
  /* The list is a *container*, and that is the fix rather than a detail. This
     line lays out five columns, and it dropped to a narrow arrangement under
     `@media (max-width: 767.98px)` -- a **viewport** query. The basket drawer is
     a 420px panel inside a 1440px window, so the viewport is never narrow, the
     wide grid was the one that applied, and 64px + a stepper + a total + a
     remove button had to share 420px. What that produced is what the drawer
     shipped: the name squeezed against a remove button stranded at the far
     right, the stepper and the price stranded on a line below it, and the two
     *controls* -- quantity and remove, the only two things on the row that do
     the same kind of job -- at opposite ends of the box.

     A container query asks the question the layout actually depends on: how
     wide is the list, not how wide is the window. The drawer and the basket
     page then get the arrangement each has room for, from one set of rules. */
  .av-cart-list {
    container-type: inline-size;
  }
  /* Narrow is the default, so a list that is *not* inside `.av-cart-list` --
     markup this partial does not own, a starter kit's own page -- gets the
     arrangement that survives any width rather than the one that needs 640px. */
  .av-cart-line {
    /* The track and the well read one property, so they cannot disagree —
       this partial learned that when the drawer set 48px on the element and
       left the track at 64px, and the gap that opened had no visible source.
       It is `--av-thumb-size` now, the property `.av-thumb` itself reads. */
    --av-thumb-size: 64px;
    display: grid;
    grid-template-columns: var(--av-thumb-size) minmax(0, 1fr) auto;
    grid-template-areas: "thumb body     price" "thumb controls controls";
    align-items: center;
    column-gap: var(--av-space-3);
    row-gap: var(--av-space-3);
    padding-block: var(--av-space-4);
  }
  .av-cart-line__thumb {
    grid-area: thumb;
    align-self: start;
  }
  .av-cart-line__body {
    grid-area: body;
  }
  .av-cart-line__total {
    grid-area: price;
    align-self: start;
  }
  .av-cart-line__controls {
    grid-area: controls;
  }
  /* The stepper and the remove button are one cluster. They were siblings with
     a whole layout between them; a reader who wants to change a line looks in
     one place for both, and the remove button stops reading as a control that
     belongs to the row above it. */
  .av-cart-line__controls {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
  }
  @container (min-width: 34rem) {
    .av-cart-line {
      grid-template-columns: var(--av-thumb-size) minmax(0, 1fr) auto auto;
      grid-template-areas: "thumb body controls price";
      column-gap: var(--av-space-4);
    }
    .av-cart-line__thumb,
    .av-cart-line__total {
      align-self: center;
    }
  }
  .av-cart-line + .av-cart-line {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-cart-line__name {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
    margin: 0;
  }
  .av-cart-line__meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin: 2px 0 0;
  }
  .av-cart-line__total {
    font-variant-numeric: tabular-nums;
    font-weight: var(--av-font-weight-semibold);
    min-inline-size: 5.5rem;
    text-align: end;
  }
  /* Only the thumb size is left to the viewport: on a genuinely small screen the
     photograph should be smaller, which is a question about the device rather
     than about how wide this list happens to be. The arrangement is the
     container's business and is handled above. */
  @media (max-width: 767.98px) {
    .av-cart-line {
      --av-thumb-size: 56px;
    }
  }
  /* Invoice ─────────────────────────────────────────────────────────── */
  .av-invoice {
    max-inline-size: 820px;
    margin-inline: auto;
    padding: var(--av-space-8);
  }
  .av-invoice__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--av-space-6);
    padding-block-end: var(--av-space-6);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  /* The issuer's mark and name, on a document rather than in the chrome.
     Both the invoice and the storefront receipt are the same document with a
     different title, and both had been carrying these five declarations
     inline — identical, byte for byte, in two files, which is a component
     with nowhere to live rather than two pages each making a choice.

     The mark used to borrow `.av-brand__mark` from `layout/_sidebar.scss` and
     then resize it. It is not that thing: `.av-brand__mark` is a 30px logo
     image in the navigation chrome, and this is a 40px lettermark inside a
     printed document. Borrowing it meant a page overriding a layout class's
     size at the same specificity, which is decided by `@use` order — the tie
     this repository has already been bitten by. It owns its box now, so there
     is no tie to resolve. */
  .av-invoice__mark {
    display: block;
    inline-size: 40px;
    block-size: 40px;
    flex: none;
    border-radius: var(--av-radius-md);
    font-size: var(--av-font-size-base);
  }
  .av-invoice__issuer {
    margin-block-start: var(--av-space-3);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-invoice__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-3xl);
    font-weight: var(--av-font-weight-bold);
    margin: 0 0 var(--av-space-3);
    letter-spacing: -0.02em;
  }
  .av-invoice__parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--av-space-6);
    padding-block: var(--av-space-6);
  }
  .av-invoice__party-label {
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-widest);
    text-transform: uppercase;
    color: var(--av-text-muted);
    margin: 0 0 var(--av-space-2);
  }
  .av-invoice__note {
    margin-block-start: var(--av-space-6);
    padding-block-start: var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* Confirmation ────────────────────────────────────────────────────── */
  /* The confirmation page's own column. It was an inline
     `style="max-inline-size: 760px; margin-inline: auto"` on the page body —
     the same blind spot the page-rhythm rule in `layout/_shell.scss` was
     written to close, one level down. */
  .av-confirm {
    max-inline-size: 760px;
    margin-inline: auto;
  }
  .av-confirm > * + * {
    margin-block-start: var(--av-space-4);
  }
  /* The hero ends in its own block padding, so the card below it needs no
     margin as well — the same statement `.av-tab-nav-bar + *` makes one
     component along, and for the same reason: a default rhythm has to be
     refusable by the component that already handles its own. */
  .av-confirm > .av-confirm-hero + * {
    margin-block-start: 0;
  }
  .av-confirm-hero {
    text-align: center;
    padding-block: var(--av-space-8) var(--av-space-6);
  }
  .av-confirm-hero__mark {
    inline-size: 64px;
    block-size: 64px;
    margin-inline: auto;
    margin-block-end: var(--av-space-4);
    border-radius: var(--av-radius-full);
    display: grid;
    place-items: center;
    background: var(--av-color-success-subtle);
    color: var(--av-color-success-text);
  }
  .av-confirm-hero__mark .av-icon {
    inline-size: 30px;
    block-size: 30px;
    stroke-width: 2.25;
  }
  .av-confirm-hero__title {
    font-size: var(--av-font-size-2xl);
    font-weight: var(--av-font-weight-bold);
    margin: 0 0 var(--av-space-2);
  }
  .av-confirm-hero__text {
    color: var(--av-text-secondary);
    max-inline-size: 52ch;
    margin-inline: auto;
  }
}
@layer components {
  /* Slide-over basket ───────────────────────────────────────────────────
     The shell is `.av-drawer`, so the open/close animation, Escape, the
     backdrop click and the focus trap all come from the component that
     already has them. What is here is only what a basket needs and a generic
     drawer does not.

     The lines are `.av-cart-line`, unchanged, and the module driving them is
     `initCart` — the same code as the full basket page. Only the *proportions*
     differ, and that is what these rules say: a 420px column has no room for
     the page version's thumbnail-plus-two-columns, so the grid is re-declared
     rather than the component being forked. */
  .av-cart-drawer {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-block-size: 0;
  }
  /* The drawer used to re-declare the whole cart-line grid here -- five areas,
     its own column list and its own thumbnail size -- because the page version
     needed more width than a 420px panel has. That override is gone, and its
     absence is the fix.

     `.av-cart-line` keys its arrangement off `@container` now, so the panel
     gets the narrow layout because the *list* is narrow, without anything
     having to say so. The override was also actively wrong: at 0-2-0 it beat
     the component's own rules, so it silently decided the layout, and what it
     decided was the arrangement this drawer shipped -- the remove button
     stranded at the top right, the line total at the bottom right, and the
     stepper at the bottom left, with the two controls that do the same job at
     opposite corners of the row.

     What is left is the one thing that is genuinely a drawer decision: a
     smaller thumbnail. It is a custom property the component reads for both
     the track and the element, so the two cannot drift apart. */
  /* Two compounds rather than one, and the extra specificity is the point.
     `.av-thumb`'s size is inherited from its container, so `.av-cart-line`
     declares the basket page's 64px on itself — and a value declared on the
     element beats one inherited from an ancestor no matter how far up it was
     set. A bare `.av-cart-drawer { --av-thumb-size: … }` therefore stopped
     reaching the wells the moment the well became a shared component.

     56px, which is the size the component already drops to on a phone. The
     48px this used to carry was a guess at how little room a 26rem panel has,
     and it made the product photograph the smallest thing in the row. */
  .av-cart-drawer .av-cart-line {
    --av-thumb-size: 56px;
  }
  /* The lines arrive just after the panel does. A list that is already there
     when the drawer lands reads as a screenshot; laid down in sequence it
     reads as a basket. Six is enough — past that the delay would be longer
     than anybody waits, so the rest share the last one. */
  .av-cart-drawer {
    --av-cart-stagger: 45ms;
  }
  .av-cart-drawer .av-cart-line {
    animation: av-cart-line-in var(--av-duration-normal) var(--av-ease-decelerate) backwards;
    animation-delay: calc(var(--av-cart-stagger) * 6);
  }
  .av-cart-drawer .av-cart-line:nth-child(1) {
    animation-delay: calc(var(--av-cart-stagger) * 1);
  }
  .av-cart-drawer .av-cart-line:nth-child(2) {
    animation-delay: calc(var(--av-cart-stagger) * 2);
  }
  .av-cart-drawer .av-cart-line:nth-child(3) {
    animation-delay: calc(var(--av-cart-stagger) * 3);
  }
  .av-cart-drawer .av-cart-line:nth-child(4) {
    animation-delay: calc(var(--av-cart-stagger) * 4);
  }
  .av-cart-drawer .av-cart-line:nth-child(5) {
    animation-delay: calc(var(--av-cart-stagger) * 5);
  }
  .av-cart-drawer .av-cart-line:nth-child(6) {
    animation-delay: calc(var(--av-cart-stagger) * 6);
  }
  @keyframes av-cart-line-in {
    from {
      opacity: 0;
      translate: 0 var(--av-space-3);
    }
  }
  /* The global reduced-motion reset zeroes durations, not delays — a stagger
     left in place would still hold the sixth line back for a quarter of a
     second after the others had appeared. */
  @media (prefers-reduced-motion: reduce) {
    .av-cart-drawer {
      --av-cart-stagger: 0ms;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-cart-drawer {
    --av-cart-stagger: 0ms;
  }
  /* Free-delivery meter. It moved out of the body and into the footer, where
     the money is: floating under the last line it sat alone in whatever empty
     space a short basket left, and it was making a promise the totals four
     inches below it were not keeping.

     A `<p>` and a bar rather than an alert, because nobody has entered a
     state — it is standing information about the order, and an alert role
     would announce it on every open. */
  .av-cart-drawer__meter {
    display: grid;
    gap: var(--av-space-2);
    padding: var(--av-space-3);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
  }
  .av-cart-drawer__meter-text {
    display: flex;
    align-items: center;
    gap: var(--av-space-2-5);
    margin: 0;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-secondary);
  }
  .av-cart-drawer__meter-text svg {
    flex: none;
    color: var(--av-text-muted);
  }
  /* Qualified is a different sentence, not just a full bar — the bar is the
     progress and the words are the news. */
  .av-cart-drawer__meter.is-free .av-cart-drawer__meter-text,
  .av-cart-drawer__meter.is-free .av-cart-drawer__meter-text svg {
    color: var(--av-color-success-text);
  }
  .av-cart-drawer__meter.is-free .av-progress__bar {
    background: var(--av-color-success);
  }
  /* The one bar in the product whose value moves while somebody is looking at
     it — a quantity goes up and the basket crosses the threshold — so it is
     the one that earns a transition. */
  .av-cart-drawer__meter .av-progress__bar {
    transition: inline-size var(--av-duration-normal) var(--av-ease-standard);
  }
  /* The footer is the part a shopper actually reads, so it does not scroll
     with the lines — that is the whole reason the drawer is a three-row grid
     rather than one scrolling column.

     The column is stated. `.av-drawer__footer` is a right-aligned flex row,
     which is right for a pair of buttons and wrong for a block of totals, and
     at equal specificity it wins on `@use` order rather than on intent — so
     `justify-content: flex-end` reached this grid and shrink-wrapped the whole
     footer against the right edge: the totals in a 150px column, the checkout
     button not spanning the panel it fills. Naming the track leaves nothing
     for that rule to distribute. */
  .av-cart-drawer__foot {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--av-space-3);
  }
  .av-cart-drawer__totals {
    display: grid;
    gap: var(--av-space-1-5);
    margin: 0 0 var(--av-space-2);
  }
  .av-cart-drawer__totals > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-4);
  }
  .av-cart-drawer__totals dt {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  .av-cart-drawer__totals dd {
    margin: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-primary);
    font-variant-numeric: tabular-nums lining-nums;
  }
  .av-cart-drawer__grand {
    padding-block-start: var(--av-space-2-5);
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-cart-drawer__grand dt {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-cart-drawer__grand dd {
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-bold);
  }
}
@layer components {
  /* Product gallery ─────────────────────────────────────────────────────
     The thumbnails are a tablist: they select which image the main frame
     shows, which is exactly what a tablist is for, and it brings arrow-key
     navigation with it. */
  .av-gallery {
    display: grid;
    gap: var(--av-space-3);
  }
  .av-gallery__frame {
    aspect-ratio: 1;
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    display: grid;
    place-items: center;
    color: var(--av-text-muted);
    overflow: hidden;
  }
  .av-gallery__frame .av-icon {
    inline-size: 72px;
    block-size: 72px;
  }
  /* The frame is `place-items: center` for the no-photograph case, which centres
     a glyph. An image has to override that or it sits centred at its intrinsic
     size inside a square well with a border of sunken surface around it. */
  .av-gallery__image {
    grid-area: 1/1;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  .av-gallery__thumb img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    border-radius: calc(var(--av-radius-md) - 2px);
  }
  /* `auto-fit` rather than a hard `repeat(4, …)`: the thumb count is the
     product's colourway count, and hard-coding four made a three-view gallery
     leave a quarter-width hole at the end of the row. */
  .av-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: var(--av-space-2);
  }
  .av-gallery__thumb {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--av-radius-md);
    border: 2px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
  }
  .av-gallery__thumb[aria-selected=true] {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  /* The gap between the struck price and the live one is structural rather
     than a margin on the struck one, and that is a fix. The margin was
     `inline-start` while `__was` is written *first* everywhere it appears, so
     the only thing separating the two figures was the whitespace text node
     between the tags — which the storefront cards, generated without a line
     break, did not have. `€86.00€69.00` is not a near miss; it is two prices
     read as one. Flex ignores that whitespace either way, so the spacing is
     the same whether the markup is pretty-printed or minified. */
  .av-price {
    display: inline-flex;
    align-items: baseline;
    gap: var(--av-space-2);
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-2xl);
    font-weight: var(--av-font-weight-bold);
    font-variant-numeric: tabular-nums;
  }
  /* The card price is the same component two steps down. A product card is
     220px wide and the display face at `2xl` was the loudest thing in the
     grid — louder than the product name, which is what the reader is actually
     scanning for. The buy box keeps the large one, where the price *is* the
     headline. */
  .av-price--sm {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-price--sm .av-price__was {
    font-size: var(--av-font-size-xs);
  }
  .av-price__was {
    font-family: var(--av-font-sans);
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-normal);
    color: var(--av-text-muted);
    text-decoration: line-through;
  }
  /* Swatches ────────────────────────────────────────────────────────── */
  .av-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-2);
  }
  .av-swatch {
    min-inline-size: 44px;
    min-block-size: 36px;
    padding-inline: var(--av-space-3);
    border-radius: var(--av-radius-md);
    border: 1px solid var(--av-border-default);
    background: var(--av-surface-base);
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    cursor: pointer;
  }
  .av-swatch[aria-pressed=true] {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-weight: var(--av-font-weight-medium);
  }
  .av-swatch:disabled {
    color: var(--av-text-disabled);
    cursor: not-allowed;
    /* Out of stock is struck through as well as dimmed, so it is not colour
       alone doing the work. */
    text-decoration: line-through;
  }
  /* Category tree ─────────────────────────────────────────────────────
     A manager rather than a list: the toolbar filters and previews sort
     orders, the rows carry the slug, the count, the visibility and their own
     actions, and the handles drag between levels as well as within one.

     Sorting by name or count is a *preview*, not a save. Manual order is the
     thing the storefront reads, so a sorted view disables the handles rather
     than letting a drag write an order the reader cannot see the whole of —
     the same reason the datagrid's filter panel never reorders rows. */
  .av-cat-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-cat-toolbar__spacer {
    flex: 1;
  }
  .av-cat-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1);
  }
  .av-cat-toolbar__label {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* The ring is painted by the wrapper on :focus-within, so the bare <input>
     inside can drop its own border without leaving a focusable control with no
     focus indication. lint-css.mjs's no-outline-none narrowing permits exactly
     this shape, and the datagrid toolbar is the same control. */
  .av-cat-toolbar__search {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    padding-inline: var(--av-space-3);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-base);
    color: var(--av-text-muted);
    min-inline-size: 220px;
  }
  .av-cat-toolbar__search:focus-within {
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 3px var(--av-color-primary-subtle);
  }
  .av-cat-toolbar__search .av-input {
    border: 0;
    background: none;
    padding-inline: 0;
    flex: 1;
    min-inline-size: 0;
  }
  .av-cat-tree, .av-cat-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-cat-tree ul {
    padding-inline-start: var(--av-space-6);
  }
  .av-cat-item[hidden] {
    display: none;
  }
  .av-cat-row {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    padding: var(--av-space-2) var(--av-space-3);
    border-radius: var(--av-radius-md);
  }
  .av-cat-row:hover {
    background: var(--av-surface-sunken);
  }
  .av-cat-row__name {
    flex: 1;
    min-inline-size: 0;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
  }
  .av-cat-row__slug {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    background: none;
    padding: 0;
  }
  .av-cat-row__count {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .av-cat-row__status {
    flex: none;
  }
  .av-cat-row__actions {
    display: flex;
    gap: var(--av-space-1);
    flex: none;
  }
  .av-cat-row__handle {
    cursor: grab;
    color: var(--av-text-muted);
    background: none;
    border: 0;
    padding: 0;
    line-height: 0;
    flex: none;
  }
  /* A sorted view is a preview, so the handle stops claiming to be draggable. */
  .av-cat-tree[data-av-cat-sorted] .av-cat-row__handle {
    cursor: default;
    color: var(--av-text-disabled);
  }
  .av-cat-row__toggle {
    background: none;
    border: 0;
    padding: 0;
    line-height: 0;
    color: var(--av-text-muted);
    cursor: pointer;
    flex: none;
    /* The caret carries its own direction, so the [dir] rule can flip it
       without the collapsed state having to know which way is forward. */
    rotate: var(--av-cat-caret, 0deg);
    transition: rotate var(--av-duration-fast) var(--av-ease-standard);
  }
  /* A 16px caret is a 16px target. The glyph keeps its size — it is a caret
     beside a name, not a button in its own right — and the box grows around it
     with padding, pulled back by an equal negative margin so the row's layout
     does not move. */
  @media (pointer: coarse) {
    .av-cat-row__toggle {
      padding: var(--av-space-1);
      margin: calc(var(--av-space-1) * -1);
    }
  }
  .av-cat-row__toggle[aria-expanded=false] {
    --av-cat-caret: -90deg;
  }
  [dir=rtl] .av-cat-row__toggle[aria-expanded=false] {
    --av-cat-caret: 90deg;
  }
  /* A leaf keeps the caret's width so every name in the column starts on the
     same line. Without it the tree reads as ragged rather than as a hierarchy. */
  .av-cat-row__toggle-spacer {
    inline-size: var(--av-space-5);
    flex: none;
  }
  .av-cat-row.is-picked {
    background: var(--av-color-primary-subtle);
    outline: 2px dashed var(--av-color-primary);
  }
  .av-cat-row.is-match {
    background: var(--av-color-warning-subtle);
  }
  .av-cat-item.is-ghost > .av-cat-row {
    background: var(--av-surface-sunken);
    color: var(--av-text-disabled);
  }
  .av-cat-item.is-dragging > .av-cat-row {
    background: var(--av-surface-raised);
    box-shadow: var(--av-shadow-md);
  }
  /* Inventory grid ──────────────────────────────────────────────────── */
  .av-stock-input {
    inline-size: 84px;
    text-align: end;
    font-variant-numeric: tabular-nums;
  }
  .av-stock-delta {
    font-size: var(--av-font-size-xs);
    font-variant-numeric: tabular-nums;
    margin-inline-start: var(--av-space-2);
  }
  .av-stock-delta--up {
    color: var(--av-color-success-text);
  }
  .av-stock-delta--down {
    color: var(--av-color-danger-text);
  }
  /* Review moderation ───────────────────────────────────────────────── */
  .av-review-card {
    display: grid;
    gap: var(--av-space-3);
  }
  .av-review-card__head {
    display: flex;
    align-items: flex-start;
    gap: var(--av-space-3);
    flex-wrap: wrap;
  }
  .av-stars {
    display: inline-flex;
    gap: 1px;
    color: var(--av-color-warning);
  }
  .av-stars .av-icon {
    inline-size: 15px;
    block-size: 15px;
  }
  .av-stars .av-icon--empty {
    color: var(--av-border-strong);
  }
  .av-review-card__body {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    line-height: var(--av-line-height-relaxed);
    margin: 0;
  }
  /* The head's third slot: the score and the date, or the score and how the
     reviewer bought. It is the smallest tier because the reviewer's name and
     their verification badge are what the eye is meant to land on — the same
     reason `--av-text-subtle` is not used here, since this is text a reader
     is expected to read rather than a label they are meant to skip. */
  .av-review-card__meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* Who wrote it, over what they wrote it about. The head is a flex row, so
     this block takes the space the avatar and the stars leave; `min-inline-size`
     is the rule every container that can hold text needs, or a long product
     name sets the block's minimum to its own width and pushes the stars out
     of the card.

     The 2px between the two lines is the block's own rhythm and belongs here
     rather than on the second line. The moderation queue had been writing it
     as a margin on that line inline, which puts one composition's internal
     spacing in the one place no gate can read it. */
  .av-review-card__identity {
    flex: 1;
    min-inline-size: 0;
    display: grid;
    gap: 2px;
  }
  .av-review-card__author {
    font-weight: var(--av-font-weight-medium);
  }
  /* The rating summary above a review list: one large figure, the count it
     was averaged over, and the recommendation rate. Three tiers of ink in a
     fixed order, so the figure is read first and the two qualifiers after
     it — which is a design, and had been written inline as four separate
     style attributes on the storefront's product page. */
  .av-rating-summary {
    display: flex;
    align-items: center;
    gap: var(--av-space-4);
    flex-wrap: wrap;
    margin-block-end: var(--av-space-4);
  }
  .av-rating-summary__score {
    font-size: var(--av-font-size-4xl);
    font-weight: var(--av-font-weight-bold);
    color: var(--av-text-primary);
  }
  .av-rating-summary__count {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
  }
  .av-rating-summary__note {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* Discount rule builder ───────────────────────────────────────────── */
  .av-rule {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: var(--av-space-2);
    align-items: center;
    padding: var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-base);
  }
  .av-rule + .av-rule {
    margin-block-start: var(--av-space-2);
  }
  .av-rule__join {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    margin-block: var(--av-space-2);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wide);
  }
  .av-rule__join::before, .av-rule__join::after {
    content: "";
    flex: 1;
    block-size: 1px;
    background: var(--av-border-subtle);
  }
  @media (max-width: 767.98px) {
    .av-rule {
      grid-template-columns: minmax(0, 1fr) auto;
    }
  }
  /* Availability, under the price. Its own line rather than part of
     `.av-price`, because the price is a figure and this is a sentence about
     whether you can have it — and on a variant page it is rewritten while the
     price stays put. */
  .av-stock-line {
    margin-block-start: var(--av-space-2);
  }
}
@layer components {
  /* Mail list ───────────────────────────────────────────────────────── */
  .av-mail-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  /* The row is the <li>, and the checkbox and the star are its children rather
     than the open button's. A <button> may not contain interactive content —
     it is invalid HTML and axe reports it as `nested-interactive`, because a
     negative tabindex does not stop assistive technology reaching a control
     inside a control. The star was a `<span role="button" tabindex="-1">` for
     exactly that reason and was therefore unreachable by keyboard; out here it
     is a real button and a real tab stop. */
  .av-mail-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: start;
    gap: var(--av-space-2);
    padding: var(--av-space-3);
    border-block-end: 1px solid var(--av-border-subtle);
    transition: background-color var(--av-duration-fastest) var(--av-ease-standard);
  }
  /* The highlight belongs to the whole row, and only the open button carries
     the state — :has() is what keeps one from being restated on the other. */
  .av-mail-row:hover {
    background: var(--av-surface-sunken);
  }
  .av-mail-row:has(.av-mail-item[aria-current=true]) {
    background: var(--av-color-primary-subtle);
  }
  .av-mail-row__star {
    border: 0;
    background: none;
    padding: 0;
    color: var(--av-text-muted);
    cursor: pointer;
    line-height: 0;
  }
  /* Same treatment as the categories caret: the star stays 16px and its
     target grows around it, so a thumb can reach it without the row growing. */
  @media (pointer: coarse) {
    .av-mail-row__star {
      padding: var(--av-space-1);
      margin: calc(var(--av-space-1) * -1);
    }
  }
  .av-mail-row__star[aria-pressed=true] {
    color: var(--av-color-warning);
    fill: var(--av-color-warning);
  }
  .av-mail-row__star[aria-pressed=true] .av-icon {
    fill: currentColor;
  }
  .av-mail-item {
    display: grid;
    /* minmax(0, 1fr), not 1fr: a bare `1fr` is `minmax(auto, 1fr)` and refuses
       to shrink below the track's min-content width. */
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
    gap: var(--av-space-2);
    padding: 0;
    /* A grid item's automatic minimum size is its content's min-content width,
       so the button refused to shrink below the widest preview line and pushed
       the subject past the pane's edge. The same rule .av-grid > *, .av-main
       and .av-sidebar all set, for the same reason. */
    min-inline-size: 0;
    cursor: pointer;
    background: none;
    inline-size: 100%;
    text-align: start;
    border: 0;
  }
  .av-mail-item:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: calc(var(--av-focus-offset) * -1);
  }
  /* Unread is carried by weight and a dot, never by colour alone. */
  .av-mail-item.is-unread .av-mail-item__from,
  .av-mail-item.is-unread .av-mail-item__subject {
    font-weight: var(--av-font-weight-semibold);
    color: var(--av-text-primary);
  }
  .av-mail-item.is-unread .av-mail-item__from::before {
    content: "";
    display: inline-block;
    inline-size: 6px;
    block-size: 6px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    margin-inline-end: var(--av-space-2);
    vertical-align: middle;
  }
  /* The row is a <button>, whose content model is phrasing content, so every
     part of it has to be a <span>. `overflow`, `width` and `min-inline-size` do
     not apply to inline boxes, so a long preview line escaped the pane instead
     of ellipsing. Give them a block formatting context explicitly — CSS display
     is independent of the HTML content model. */
  .av-mail-item__body {
    display: block;
    min-inline-size: 0;
  }
  .av-mail-item__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-2);
  }
  .av-mail-item__from {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-mail-item__subject {
    display: block;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    margin-block-start: 2px;
  }
  .av-mail-item__preview {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
  .av-mail-item__labels {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-1);
    margin-block-start: var(--av-space-2);
  }
  .av-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  /* Message detail ──────────────────────────────────────────────────── */
  .av-message-head {
    padding: var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-message-head__subject {
    font-size: var(--av-font-size-xl);
    font-weight: var(--av-font-weight-semibold);
    margin: 0 0 var(--av-space-3);
  }
  .av-message-head__meta {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    flex-wrap: wrap;
  }
  /* Both of these are the reading pane's *edges*, and nothing else. The
     typography of the message itself is `components/_prose.scss` and the
     button row is `components/_actions.scss`, because four other screens
     wanted those two things without the pane they were written for. */
  .av-message-body {
    padding: var(--av-space-5);
  }
  .av-message-actions {
    padding: 0 var(--av-space-5) var(--av-space-5);
  }
  /* A mailbox with nothing in it says so. A list that is simply blank reads as
     a page that failed to load, which is the one thing an empty state must
     never look like. */
  .av-mail-empty {
    margin: 0;
    padding: var(--av-space-8) var(--av-space-4);
    text-align: center;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-muted);
  }
  /* Shortcut help moved to `components/_shortcuts.scss`. It lived here because
     mail was the one screen with shortcuts; every page has them now, and a
     component named after its first caller is the accident this stylesheet has
     already corrected for `.av-section` and `.av-avatar`. */
}
@layer components {
  /* Chat ────────────────────────────────────────────────────────────────
     Three rows: header, scrolling log, composer. The log is the only part
     that scrolls, so the composer never leaves the bottom of the pane. */
  .av-chat {
    display: grid;
    grid-template-rows: auto 1fr auto;
    block-size: 100%;
    min-block-size: 0;
    position: relative;
  }
  .av-chat__header {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
  }
  /* This is the page's <h1>. The base :where(h1) rule sizes it as a page title,
     so restate both size and margin. */
  .av-chat__name {
    font-size: var(--av-font-size-base);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  .av-chat__meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  .av-chat__header-actions {
    margin-inline-start: auto;
    display: flex;
    gap: var(--av-space-1);
  }
  .av-chat__messages {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--av-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--av-space-4);
    min-block-size: 0;
  }
  .av-chat__day-divider {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wide);
  }
  .av-chat__day-divider::before,
  .av-chat__day-divider::after {
    content: "";
    flex: 1;
    block-size: 1px;
    background: var(--av-border-subtle);
  }
  /* ══ Message ════════════════════════════════════════════════════════
     Mirrored: incoming on the inline start, your own on the inline end.

     **This reverses a decision that used to be written down here**, and the
     note it replaces said a mirrored layout "breaks down the moment a thread
     has three people in it". That is not what happens, and the reason is worth
     keeping: side does not identify the speaker — the **avatar** does. Side
     answers a different and more useful question, *is this mine*, which is the
     one a reader scanning a thread asks first and which a single tinted bubble
     among many left-aligned ones answers slowly.

     Placement is explicit (`grid-column`/`grid-row`) rather than done with
     `order` or `row-reverse`, so **the DOM order never changes**: the avatar
     still precedes the text it belongs to, which is the order a screen reader
     reads and the order the `role="log"` announces. A visual mirror that
     reorders the document is a mirror that lies to anyone not looking at it. */
  .av-message {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: var(--av-space-3);
    /* The avatar sits level with the *last* line of the bubble, which is how a
       long message stays visually attached to who sent it. */
    align-items: end;
  }
  .av-message--own {
    grid-template-columns: minmax(0, 1fr) 32px;
  }
  .av-message--own > .av-avatar {
    grid-column: 2;
    grid-row: 1;
  }
  .av-message--own > .av-message__body {
    grid-column: 1;
    grid-row: 1;
  }
  .av-message__body {
    min-inline-size: 0;
  }
  /* `text-align` moves the bubble, which is an inline-block; the header is a
     flex row and ignores it, so it needs saying twice or the name sits on one
     side of the thread and the message it names on the other. */
  .av-message--own .av-message__body {
    text-align: end;
  }
  .av-message--own .av-message__header {
    justify-content: flex-end;
  }
  /* A run from one person is one block. Repeating the avatar and the name on
     every line is what makes a chat log look like a table of records rather
     than a conversation — the reference this was measured against stamps the
     same face twice for two messages a minute apart. A continuation keeps the
     column so the bubbles stay aligned, and drops the parts that would only
     repeat themselves. */
  .av-message--cont {
    margin-block-start: calc(var(--av-space-4) * -1 + var(--av-space-1));
  }
  .av-message--cont > .av-avatar {
    visibility: hidden;
  }
  .av-message--cont .av-message__header {
    display: none;
  }
  .av-message__header {
    display: flex;
    align-items: baseline;
    gap: var(--av-space-2);
  }
  .av-message__author {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-message__time {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .av-message__text {
    font-size: var(--av-font-size-sm);
    color: var(--av-text-secondary);
    line-height: var(--av-line-height-relaxed);
    /* pre-wrap, not pre: Shift+Enter line breaks are meaningful and must
       survive, but long lines still have to wrap inside the pane. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin-block-start: 2px;
    display: inline-block;
    text-align: start;
    padding: var(--av-space-2) var(--av-space-3);
    background: var(--av-surface-sunken);
    border-radius: var(--av-radius-lg);
    /* A bubble that reaches the far edge stops reading as a bubble, and the
       ragged end is what lets the eye follow one speaker down the column. */
    max-inline-size: 88%;
    /* The corner nearest the speaker is tightened. It does the job a tail used
       to do — pointing at whose message this is — without the dated notch, and
       it survives a radius axis that a hand-drawn tail would not. */
    border-start-start-radius: var(--av-radius-sm);
  }
  .av-message--own .av-message__text {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
    border-start-start-radius: var(--av-radius-lg);
    border-start-end-radius: var(--av-radius-sm);
  }
  /* Mid-run bubbles lose the pointer entirely: only the first of a run points. */
  .av-message--cont .av-message__text {
    border-start-start-radius: var(--av-radius-lg);
  }
  .av-message--cont.av-message--own .av-message__text {
    border-start-end-radius: var(--av-radius-lg);
  }
  .av-message__reactions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-1);
    margin-block-start: var(--av-space-2);
  }
  .av-reaction {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1);
    padding: 1px var(--av-space-2);
    border-radius: var(--av-radius-full);
    border: 1px solid var(--av-border-subtle);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    cursor: pointer;
    line-height: 1.6;
  }
  .av-reaction.is-active {
    border-color: var(--av-color-primary);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-chat__typing {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    min-block-size: 20px;
  }
  .av-typing-dots {
    display: inline-flex;
    gap: 3px;
  }
  .av-typing-dots i {
    inline-size: 5px;
    block-size: 5px;
    border-radius: var(--av-radius-full);
    background: var(--av-text-subtle);
    animation: av-typing 1.2s var(--av-ease-standard) infinite;
  }
  .av-typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
  }
  .av-typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
  }
  @keyframes av-typing {
    0%, 60%, 100% {
      opacity: 0.3;
      translate: 0 0;
    }
    30% {
      opacity: 1;
      translate: 0 -3px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .av-typing-dots i {
      animation: none;
      opacity: 0.6;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]) .av-typing-dots i {
    animation: none;
    opacity: 0.6;
  }
  /* The pill that appears when new messages arrive while you are scrolled up
     reading history. Without it, either the view yanks or you miss the message. */
  .av-chat__new {
    position: absolute;
    inset-block-end: 84px;
    inset-inline: 0;
    margin-inline: auto;
    inline-size: fit-content;
    z-index: var(--av-z-raised);
    box-shadow: var(--av-shadow-lg);
  }
  .av-chat__composer {
    display: flex;
    align-items: flex-end;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-start: 1px solid var(--av-border-subtle);
    background: var(--av-surface-raised);
  }
  .av-chat__composer textarea {
    flex: 1;
    min-inline-size: 0;
    min-block-size: 40px;
    max-block-size: 140px;
    resize: none;
    overflow-y: auto;
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-base);
    color: var(--av-text-primary);
    font: inherit;
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-normal);
  }
  .av-chat__composer textarea:focus-visible {
    outline: none;
    border-color: var(--av-color-primary);
    box-shadow: 0 0 0 3px var(--av-color-primary-subtle);
  }
  /* Conversation list in the left pane. */
  .av-convo {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--av-space-3);
    align-items: center;
    inline-size: 100%;
    padding: var(--av-space-3);
    border: 0;
    border-block-end: 1px solid var(--av-border-subtle);
    background: none;
    text-align: start;
    cursor: pointer;
  }
  .av-convo:hover {
    background: var(--av-surface-sunken);
  }
  .av-convo[aria-current=true] {
    background: var(--av-color-primary-subtle);
  }
  .av-convo__body {
    min-inline-size: 0;
    display: block;
  }
  .av-convo__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--av-space-2);
  }
  .av-convo__name {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-convo__time {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  .av-convo__preview {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
}
@layer components {
  /* File manager ────────────────────────────────────────────────────────
     One markup, two presentations. The grid/list switch changes only the
     container's display, so the DOM order — and therefore the tab order and
     the reading order — is identical in both. */
  .av-files {
    display: grid;
    grid-template-rows: auto 1fr;
    block-size: 100%;
    min-block-size: 0;
  }
  .av-files__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-files__toolbar-spacer {
    margin-inline-start: auto;
  }
  /* The page's `<h1>`, at body size. It is still the document's heading — a
     split view has no page header to carry one — but it sits in a toolbar
     beside a count and a set of controls, and a display-sized title there
     would read as a section break rather than a label. Size is not
     structure. */
  .av-files__title {
    font-size: var(--av-font-size-base);
  }
  .av-files__scroll {
    overflow-y: auto;
    padding: var(--av-space-4);
  }
  .av-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  /* Grid presentation */
  .av-file-list[data-av-state=grid] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--av-space-3);
  }
  .av-file-list[data-av-state=grid] .av-file {
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
  }
  .av-file-list[data-av-state=grid] .av-file__meta {
    margin-inline-start: 0;
  }
  .av-file-list[data-av-state=grid] .av-file__icon {
    inline-size: 100%;
    block-size: 76px;
    border-radius: var(--av-radius-md);
  }
  /* List presentation */
  .av-file-list[data-av-state=list] {
    display: block;
  }
  .av-file-list[data-av-state=list] .av-file {
    border-radius: var(--av-radius-md);
  }
  /* `:where()` carries the state without carrying its specificity. Written
     plainly this selector is 0-4-0 and over the budget, and the only thing the
     extra unit buys is making the rule harder to override. */
  .av-file-list:where([data-av-state=list]) .av-file + .av-file {
    border-block-start: 1px solid var(--av-border-subtle);
    border-radius: 0;
  }
  .av-file {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    inline-size: 100%;
    padding: var(--av-space-3);
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    text-align: start;
    min-inline-size: 0;
  }
  .av-file:hover {
    background: var(--av-surface-sunken);
  }
  .av-file[aria-current=true] {
    background: var(--av-color-primary-subtle);
    border-color: var(--av-color-primary-border);
    border-radius: var(--av-radius-md);
  }
  .av-file__icon {
    flex: none;
    inline-size: 36px;
    block-size: 36px;
    border-radius: var(--av-radius-sm);
    display: grid;
    place-items: center;
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
  }
  .av-file__icon--folder {
    color: var(--av-color-warning);
  }
  .av-file__icon--image {
    color: var(--av-color-info);
  }
  .av-file__icon--doc {
    color: var(--av-color-primary);
  }
  .av-file__body {
    min-inline-size: 0;
    flex: 1;
    display: block;
  }
  .av-file__name {
    display: block;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-file__meta {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
    white-space: nowrap;
  }
  /* Folder tree ─────────────────────────────────────────────────────── */
  .av-tree, .av-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-tree ul {
    padding-inline-start: var(--av-space-4);
  }
  .av-tree__link {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    inline-size: 100%;
    min-block-size: 34px;
    padding-inline: var(--av-space-2);
    border: 0;
    border-radius: var(--av-radius-sm);
    background: none;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
    text-align: start;
    cursor: pointer;
  }
  .av-tree__link:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .av-tree__link[aria-current=true] {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-weight: var(--av-font-weight-medium);
  }
  .av-tree__twisty {
    flex: none;
    inline-size: 16px;
    block-size: 16px;
    transition: rotate var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-tree__link[aria-expanded=true] .av-tree__twisty {
    rotate: 90deg;
  }
  [dir=rtl] .av-tree__twisty {
    scale: -1 1;
  }
  .av-tree__count {
    margin-inline-start: auto;
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  /* Storage meter in the tree pane. */
  .av-storage {
    margin-block-start: var(--av-space-5);
  }
  .av-storage__label {
    display: flex;
    justify-content: space-between;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-end: var(--av-space-2);
  }
  /* Preview pane ────────────────────────────────────────────────────── */
  .av-preview {
    padding: var(--av-space-5);
  }
  /* The preview placeholder dictates its own glyph size, so it sets the
     property rather than the author remembering a step: 48px sits between
     `--xl` and `--2xl` and is this component's decision, not a scale step. */
  .av-preview__frame .av-icon {
    --av-icon-size: 48px;
  }
  .av-preview__frame {
    aspect-ratio: 4/3;
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
    border: 1px solid var(--av-border-subtle);
    display: grid;
    place-items: center;
    color: var(--av-text-muted);
    margin-block-end: var(--av-space-4);
  }
  .av-preview__name {
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    margin: 0 0 var(--av-space-1);
    overflow-wrap: anywhere;
  }
  /* Contacts ───────────────────────────────────────────────────────── */
  .av-contact-group {
    position: sticky;
    inset-block-start: 0;
    z-index: var(--av-z-raised);
    padding: var(--av-space-1) var(--av-space-3);
    background: var(--av-surface-sunken);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-widest);
    text-transform: uppercase;
  }
  .av-contact {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: var(--av-space-3);
    align-items: center;
    inline-size: 100%;
    padding: var(--av-space-3);
    border: 0;
    border-block-end: 1px solid var(--av-border-subtle);
    background: none;
    text-align: start;
    cursor: pointer;
  }
  .av-contact:hover {
    background: var(--av-surface-sunken);
  }
  .av-contact[aria-current=true] {
    background: var(--av-color-primary-subtle);
  }
  .av-contact__body {
    min-inline-size: 0;
    display: block;
  }
  .av-contact__name {
    display: block;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
  }
  .av-contact__role {
    display: block;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-contact-detail {
    padding: var(--av-space-6);
  }
  .av-contact-detail__head {
    display: flex;
    align-items: center;
    gap: var(--av-space-4);
    margin-block-end: var(--av-space-5);
  }
  .av-contact-detail__name {
    font-size: var(--av-font-size-xl);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
  }
  .av-contact-detail__role {
    color: var(--av-text-muted);
    font-size: var(--av-font-size-sm);
    margin: 2px 0 0;
  }
}
@layer components {
  /* Task list ───────────────────────────────────────────────────────── */
  .av-tasks {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-task {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-task:hover {
    background: var(--av-surface-sunken);
  }
  .av-task__title {
    min-inline-size: 0;
    font-size: var(--av-font-size-sm);
    color: var(--av-text-primary);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--av-radius-sm);
    padding: var(--av-space-1) var(--av-space-2);
    margin-inline-start: calc(var(--av-space-2) * -1);
    font: inherit;
    font-size: var(--av-font-size-sm);
    inline-size: 100%;
    text-overflow: ellipsis;
  }
  /* The title is an <input> so editing needs no mode switch — but it must not
     look like a form field until you are in it. */
  .av-task__title:hover {
    border-color: var(--av-border-subtle);
  }
  .av-task__title:focus-visible {
    outline: none;
    border-color: var(--av-color-primary);
    background: var(--av-surface-base);
    box-shadow: 0 0 0 3px var(--av-color-primary-subtle);
    text-overflow: clip;
  }
  .av-task.is-done .av-task__title {
    text-decoration: line-through;
    color: var(--av-text-muted);
  }
  .av-task__due {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  /* Overdue is carried by an icon and the word, not by red alone. */
  .av-task__due.is-overdue {
    color: var(--av-color-danger-text);
    font-weight: var(--av-font-weight-medium);
  }
  .av-task.is-done .av-task__due {
    color: var(--av-text-muted);
    font-weight: var(--av-font-weight-normal);
  }
  /* `.av-check` is already 18px; this repeated the base value and, because it
     is a later partial at equal specificity, it was the declaration that won —
     so the task list was the one checkbox list the touch minimum could not
     reach. A component that restates a default silently owns it. */
  .av-task-add {
    display: flex;
    gap: var(--av-space-2);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  /* Notes ───────────────────────────────────────────────────────────── */
  .av-note-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-note-item {
    display: block;
    inline-size: 100%;
    padding: var(--av-space-3) var(--av-space-4);
    border: 0;
    border-block-end: 1px solid var(--av-border-subtle);
    background: none;
    text-align: start;
    cursor: pointer;
  }
  .av-note-item:hover {
    background: var(--av-surface-sunken);
  }
  .av-note-item[aria-current=true] {
    background: var(--av-color-primary-subtle);
  }
  .av-note-item__title {
    display: block;
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-note-item__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin-block-start: 2px;
  }
  .av-note-item__foot {
    display: flex;
    align-items: center;
    gap: var(--av-space-2);
    margin-block-start: var(--av-space-2);
  }
  .av-note-editor {
    display: grid;
    grid-template-rows: auto 1fr auto;
    block-size: 100%;
    min-block-size: 0;
  }
  .av-note-editor__head {
    padding: var(--av-space-4) var(--av-space-5);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-note-editor__title {
    inline-size: 100%;
    border: 0;
    background: none;
    color: var(--av-text-primary);
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-xl);
    font-weight: var(--av-font-weight-bold);
    padding: 0;
  }
  /* Both editor fields are deliberately borderless, which left a keyboard user
     tabbing in from the note list with nothing to see at all. A ring on
     `:focus-visible` keeps the seamless look for the pointer and restores the
     indication for the keyboard. */
  .av-note-editor__title:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 2px;
    border-radius: var(--av-radius-sm);
  }
  .av-note-editor__body {
    inline-size: 100%;
    border: 0;
    resize: none;
    background: none;
    color: var(--av-text-secondary);
    font: inherit;
    font-size: var(--av-font-size-sm);
    line-height: var(--av-line-height-relaxed);
    padding: var(--av-space-5);
    overflow-y: auto;
  }
  .av-note-editor__body:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 2px;
    border-radius: var(--av-radius-sm);
  }
  .av-note-editor__foot {
    display: flex;
    align-items: center;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-5);
    border-block-start: 1px solid var(--av-border-subtle);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
  }
  /* 14px was written inline on the tick. It is a size decision for this
     indicator, not per-instance data, so it lives with the class. */
  .av-save-state {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1-5);
  }
  .av-save-state .av-icon {
    inline-size: 14px;
    block-size: 14px;
  }
  .av-save-state[data-av-state=saving] {
    color: var(--av-text-muted);
  }
  .av-save-state[data-av-state=saved] {
    color: var(--av-color-success-text);
  }
  .av-save-state[data-av-state=dirty] {
    color: var(--av-color-warning-text);
  }
}
@layer components {
  .av-calendar {
    display: grid;
    grid-template-rows: auto auto 1fr;
    block-size: 100%;
    min-block-size: 0;
  }
  .av-calendar__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--av-space-3);
    padding: var(--av-space-3) var(--av-space-4);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-calendar__title {
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    margin: 0;
    min-inline-size: 11ch;
  }
  .av-calendar__nav {
    display: flex;
    gap: var(--av-space-1);
  }
  .av-calendar__spacer {
    margin-inline-start: auto;
  }
  /* The grid is a real <table>: a month is tabular data, and the day-of-week
     headers are column headers that a screen reader should announce as such. */
  .av-calendar__grid {
    inline-size: 100%;
    block-size: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .av-calendar__grid th {
    padding: var(--av-space-2);
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wide);
    text-transform: uppercase;
    color: var(--av-text-muted);
    text-align: start;
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-calendar__grid td {
    border: 1px solid var(--av-border-subtle);
    vertical-align: top;
    padding: 0;
    block-size: 92px;
  }
  .av-day {
    display: flex;
    flex-direction: column;
    gap: var(--av-space-1);
    inline-size: 100%;
    block-size: 100%;
    min-block-size: 92px;
    padding: var(--av-space-2);
    border: 0;
    background: none;
    text-align: start;
    cursor: pointer;
    overflow: hidden;
  }
  .av-day:hover {
    background: var(--av-surface-sunken);
  }
  .av-day:focus-visible {
    outline: var(--av-focus-width) solid var(--av-focus-color);
    outline-offset: calc(var(--av-focus-offset) * -1);
  }
  /* The state is on the cell, not on the button: `aria-selected` is not an
     allowed attribute on role=button, and it was 42 axe nodes per rendering
     until the grid declared its roles. The paint follows it up one level. */
  td[aria-selected=true] > .av-day {
    background: var(--av-color-primary-subtle);
  }
  .av-day--outside {
    color: var(--av-text-disabled);
  }
  .av-day--outside .av-day__number {
    opacity: 0.5;
  }
  .av-day__number {
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-medium);
    color: var(--av-text-secondary);
    align-self: flex-start;
  }
  /* Today is a filled marker, not just a colour, so it survives greyscale. */
  .av-day--today .av-day__number {
    display: grid;
    place-items: center;
    min-inline-size: 22px;
    block-size: 22px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-event {
    display: flex;
    align-items: center;
    gap: var(--av-space-1);
    inline-size: 100%;
    padding: 1px var(--av-space-1-5);
    border-radius: var(--av-radius-sm);
    font-size: var(--av-font-size-2xs);
    line-height: 1.7;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid transparent;
  }
  /* The label is its own element rather than a bare text node: an anonymous
     flex item will not shrink below min-content, so the title was clipped
     mid-word by the cell instead of ellipsing inside the chip. */
  .av-event__label {
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .av-event__dot {
    flex: none;
    inline-size: 6px;
    block-size: 6px;
    border-radius: var(--av-radius-full);
    background: currentColor;
  }
  .av-event--primary {
    background: var(--av-color-primary-subtle);
    border: 1px solid var(--av-color-primary-border);
    color: var(--av-color-primary-text);
  }
  .av-event--success {
    background: var(--av-color-success-subtle);
    border: 1px solid var(--av-color-success-border);
    color: var(--av-color-success-text);
  }
  .av-event--warning {
    background: var(--av-color-warning-subtle);
    border: 1px solid var(--av-color-warning-border);
    color: var(--av-color-warning-text);
  }
  .av-event--danger {
    background: var(--av-color-danger-subtle);
    border: 1px solid var(--av-color-danger-border);
    color: var(--av-color-danger-text);
  }
  .av-event--info {
    background: var(--av-color-info-subtle);
    border: 1px solid var(--av-color-info-border);
    color: var(--av-color-info-text);
  }
  .av-day__more {
    font-size: var(--av-font-size-2xs);
    color: var(--av-text-muted);
  }
  /* Agenda list beside the grid. */
  /* The agenda pane, and it is the only split detail in the product that did
     not have a name. Mail's is `.av-message-head`, chat's is `.av-chat`,
     contacts' is `.av-contact-detail`, files' is `.av-preview` — the calendar
     had an unclassed `<div>` carrying its padding inline, which is the same
     component written in the one place no gate reads. */
  .av-agenda-pane {
    padding: var(--av-space-5);
  }
  .av-agenda-pane__heading {
    font-size: var(--av-font-size-base);
    margin-block-end: var(--av-space-3);
  }
  /* The calendar filter list: one column, not the wrapping row the chips make
     elsewhere, because the pane it sits in is narrow and a wrapped second line
     of chips reads as two groups. */
  .av-calendar__filters {
    display: grid;
    gap: var(--av-space-2);
  }
  .av-agenda {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .av-agenda__item {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr);
    gap: var(--av-space-3);
    padding-block: var(--av-space-3);
  }
  .av-agenda__item + .av-agenda__item {
    border-block-start: 1px solid var(--av-border-subtle);
  }
  .av-agenda__bar {
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
  }
  .av-agenda__item--primary .av-agenda__bar {
    background: var(--av-color-primary);
  }
  .av-agenda__item--success .av-agenda__bar {
    background: var(--av-color-success);
  }
  .av-agenda__item--warning .av-agenda__bar {
    background: var(--av-color-warning);
  }
  .av-agenda__item--danger .av-agenda__bar {
    background: var(--av-color-danger);
  }
  .av-agenda__item--info .av-agenda__bar {
    background: var(--av-color-info);
  }
  .av-agenda__title {
    font-size: var(--av-font-size-sm);
    font-weight: var(--av-font-weight-medium);
    margin: 0;
  }
  .av-agenda__meta {
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    margin: 2px 0 0;
  }
  @media (max-width: 767.98px) {
    .av-calendar__grid td {
      block-size: 64px;
    }
    .av-day {
      min-block-size: 64px;
    }
    /* At this width a chip is a coloured bar with no room for a label; the
       agenda beside the grid carries the detail. */
    .av-event {
      padding: 3px;
      gap: 0;
    }
    .av-event__label {
      display: none;
    }
    .av-event__dot {
      inline-size: 100%;
      block-size: 4px;
      border-radius: var(--av-radius-full);
    }
  }
  /* The view switcher sits at the end of the toolbar. */
  .av-calendar__views {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-1);
    margin-inline-start: auto;
  }
  .av-calendar__board {
    padding: var(--av-space-4);
  }
  /* Time grid ───────────────────────────────────────────────────────── */
  /* A week or a day against the clock. Three rows share one set of columns
     (a gutter for the hour labels, then one column per day), so the day
     headers, the all-day strip and the hours line up without measuring.
     `--av-timegrid-days` and `--av-timegrid-hours` are counts the runtime
     writes; an event carries its own start and length as percentages of the
     day in `--av-event-start` and `--av-event-span`. */
  .av-timegrid {
    --av-timegrid-hour: var(--av-space-12);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    overflow: hidden;
  }
  .av-timegrid__head,
  .av-timegrid__allday,
  .av-timegrid__body {
    display: grid;
    grid-template-columns: var(--av-space-12) repeat(var(--av-timegrid-days, 7), minmax(0, 1fr));
  }
  .av-timegrid__head,
  .av-timegrid__allday {
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .av-timegrid__day {
    display: grid;
    justify-items: center;
    gap: var(--av-space-0-5);
    padding: var(--av-space-2);
    border: 0;
    border-inline-start: 1px solid var(--av-border-subtle);
    background: transparent;
    color: var(--av-text-secondary);
    font: inherit;
    cursor: pointer;
  }
  .av-timegrid__day:hover {
    background: var(--av-surface-sunken);
  }
  .av-timegrid__day[aria-pressed=true] {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  .av-timegrid__weekday {
    font-size: var(--av-font-size-xs);
  }
  .av-timegrid__date {
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    font-variant-numeric: tabular-nums;
  }
  .av-timegrid__day[aria-current=date] .av-timegrid__date {
    color: var(--av-color-primary-text);
  }
  .av-timegrid__label {
    padding: var(--av-space-1) var(--av-space-2);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .av-timegrid__cell {
    display: grid;
    align-content: start;
    gap: var(--av-space-1);
    min-block-size: var(--av-space-8);
    padding: var(--av-space-1);
    border-inline-start: 1px solid var(--av-border-subtle);
  }
  .av-timegrid__body {
    block-size: calc(var(--av-timegrid-hours, 14) * var(--av-timegrid-hour));
  }
  .av-timegrid__hours {
    display: grid;
    grid-auto-rows: var(--av-timegrid-hour);
  }
  /* The hour lines are one repeating background, a line at the top of each hour. */
  .av-timegrid__col {
    position: relative;
    border-inline-start: 1px solid var(--av-border-subtle);
    background: repeating-linear-gradient(to bottom, var(--av-border-subtle) 0 1px, transparent 1px var(--av-timegrid-hour));
  }
  .av-timegrid__event {
    --av-timegrid-tone: var(--av-color-primary);
    display: grid;
    align-content: start;
    padding: var(--av-space-1) var(--av-space-2);
    overflow: hidden;
    background: color-mix(in oklab, var(--av-timegrid-tone) 14%, var(--av-surface-raised));
    border-inline-start: 3px solid var(--av-timegrid-tone);
    border-radius: var(--av-radius-sm);
    font-size: var(--av-font-size-xs);
    color: var(--av-text-primary);
  }
  .av-timegrid__col .av-timegrid__event {
    position: absolute;
    inset-inline: var(--av-space-1);
    inset-block-start: calc(var(--av-event-start, 0) * 1%);
    block-size: calc(var(--av-event-span, 7) * 1%);
  }
  .av-timegrid__event--info {
    --av-timegrid-tone: var(--av-color-info);
  }
  .av-timegrid__event--success {
    --av-timegrid-tone: var(--av-color-success);
  }
  .av-timegrid__event--warning {
    --av-timegrid-tone: var(--av-color-warning);
  }
  .av-timegrid__event--danger {
    --av-timegrid-tone: var(--av-color-danger);
  }
  .av-timegrid__event-time {
    color: var(--av-text-secondary);
    font-variant-numeric: tabular-nums;
  }
  /* One line each: a column in a seven-day week is narrow, and the agenda
     beside the grid carries the full title. */
  :is(.av-timegrid__event-time, .av-timegrid__event-title) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .av-timegrid__event-title {
    font-weight: var(--av-font-weight-semibold);
  }
  /* Year ────────────────────────────────────────────────────────────── */
  /* Twelve small months. Each is one button that opens its month; the days
     inside are decoration (the button's label carries the count), so the year
     is twelve tab stops and not three hundred and sixty-five. */
  .av-year {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(var(--av-space-32) * 1.5), 1fr));
    gap: var(--av-space-4);
  }
  .av-year__month {
    display: grid;
    align-content: start;
    gap: var(--av-space-2);
    padding: var(--av-space-3);
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
    transition: border-color var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-year__month:hover {
    border-color: var(--av-color-primary);
  }
  .av-year__title {
    font-weight: var(--av-font-weight-semibold);
  }
  .av-year__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--av-space-0-5);
  }
  .av-year__day {
    padding-block: var(--av-space-0-5);
    border-radius: var(--av-radius-sm);
    font-size: var(--av-font-size-xs);
    text-align: center;
    color: var(--av-text-secondary);
    font-variant-numeric: tabular-nums;
  }
  .av-year__day--busy {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-weight: var(--av-font-weight-semibold);
  }
  .av-year__day--today {
    box-shadow: inset 0 0 0 1px var(--av-color-primary);
  }
}
@layer components {
  /* Event composer ──────────────────────────────────────────────────────
     Ordinary fields in an ordinary dialog. One rule earns its place: the
     all-day switch hides the two time inputs, and it does that in CSS via
     `:has()` rather than in a module.

     `display: none` rather than `visibility` or opacity, because a hidden time
     field that still submits is the bug this is preventing — somebody ticks
     "all day", the 09:00 they typed earlier stays in the payload, and the
     event is booked for an hour. A `display: none` control is also skipped by
     constraint validation, which is the behaviour wanted here and the exact
     behaviour that had to be worked around for the rich text editor: there the
     hidden field was `required` and stopped the form dead. The difference is
     that these two are optional, so removing them from validation removes
     nothing anybody has to satisfy. */
  .av-event-form {
    display: grid;
    gap: var(--av-space-4);
  }
  .av-event-form:has([data-av-event-allday]:checked) .av-event-form__time {
    display: none;
  }
  /* The switch row. It is not a `.av-choice` because it is a toggle rather
     than a selection among alternatives, and it is not a `.av-field` because
     the control sits beside its description rather than under a label. */
  .av-event-form__allday {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--av-space-4);
    padding: var(--av-space-3) var(--av-space-4);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-lg);
    background: var(--av-surface-sunken);
  }
}
@layer plugins {
  /* Chart placeholder (static SVG until the chart module lands) ─────── */
  .av-chart-frame {
    inline-size: 100%;
  }
  .av-chart-frame svg {
    inline-size: 100%;
    block-size: auto;
  }
}
@layer plugins {
  .ts-hidden-accessible {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .ts-wrapper {
    position: relative;
    min-inline-size: 0;
  }
  /* Tom Select copies the original <select>'s class list onto its wrapper. That
     is deliberate on its part and reasonable — but a consumer who styled the
     native control for the no-JS case, which is exactly what `.av-select` is
     for and exactly what they should write, then gets that chrome painted
     twice: an outer bordered box from the copied class, and the real control
     inside it. It reads as a box in a box, with the caret stranded in the gap.
     Anything the enhanced control needs is on `.ts-control`, so the copy is
     stripped back to a bare positioning box.
     Layer order does the work — `plugins` is emitted after `components`, so
     this wins without out-specifying `.av-select`. */
  .ts-wrapper.av-select,
  .ts-wrapper.av-input {
    min-block-size: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .ts-control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-1-5);
    inline-size: 100%;
    min-block-size: var(--av-control-height, var(--av-control-md));
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-select-border, var(--av-border-default));
    border-radius: var(--av-radius-md);
    background: var(--av-surface-base);
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--av-select-ring, transparent);
    transition: border-color var(--av-duration-fast) var(--av-ease-standard), box-shadow var(--av-duration-fast) var(--av-ease-standard);
  }
  .ts-wrapper.focus {
    --av-select-border: var(--av-color-primary);
    --av-select-ring: var(--av-color-primary-subtle);
  }
  .ts-wrapper.is-invalid {
    --av-select-border: var(--av-color-danger);
    --av-select-ring: transparent;
  }
  .ts-wrapper.is-invalid.focus {
    --av-select-ring: var(--av-color-danger-subtle);
  }
  .ts-wrapper.disabled .ts-control {
    background: var(--av-surface-sunken);
    color: var(--av-text-disabled);
    cursor: not-allowed;
  }
  .ts-wrapper.single::after {
    content: "";
    position: absolute;
    inset-inline-end: var(--av-space-3);
    inset-block-start: 50%;
    inline-size: 8px;
    block-size: 8px;
    border-inline-end: 1.5px solid var(--av-text-muted);
    border-block-end: 1.5px solid var(--av-text-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
  }
  .ts-control input {
    flex: 1 1 auto;
    min-inline-size: 4ch;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    outline: none;
  }
  .ts-control input::placeholder {
    color: var(--av-text-muted);
  }
  .ts-wrapper.multi .item {
    display: inline-flex;
    align-items: center;
    gap: var(--av-space-1);
    padding: 2px var(--av-space-2);
    border-radius: var(--av-radius-sm);
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
    font-size: var(--av-font-size-xs);
  }
  .ts-control .remove {
    display: inline-grid;
    place-items: center;
    inline-size: 14px;
    block-size: 14px;
    border-radius: var(--av-radius-full);
    color: inherit;
    text-decoration: none;
    opacity: 0.7;
  }
  .ts-control .remove:hover {
    opacity: 1;
  }
  .ts-control .remove:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 1px;
    opacity: 1;
  }
  .ts-dropdown {
    position: absolute;
    z-index: var(--av-z-popover);
    margin-block-start: var(--av-space-1);
    padding: var(--av-space-1);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-raised);
    box-shadow: var(--av-shadow-lg);
    font-size: var(--av-font-size-sm);
  }
  .ts-dropdown .ts-dropdown-content {
    max-block-size: 16rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .ts-dropdown .option {
    padding: var(--av-space-2) var(--av-space-3);
    border-radius: var(--av-radius-sm);
    color: var(--av-text-primary);
    cursor: pointer;
  }
  .ts-dropdown .option.active,
  .ts-dropdown .option:hover {
    background: var(--av-surface-sunken);
  }
  .ts-dropdown .option.selected {
    color: var(--av-color-primary-text);
    font-weight: var(--av-font-weight-medium);
  }
  .ts-dropdown .no-results {
    padding: var(--av-space-2) var(--av-space-3);
    color: var(--av-text-muted);
    cursor: default;
  }
  .ts-dropdown .optgroup-header {
    padding: var(--av-space-2) var(--av-space-3) var(--av-space-1);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--av-tracking-wide);
  }
  .ts-dropdown .create {
    color: var(--av-color-primary-text);
  }
}
@layer plugins {
  .goverlay {
    background: var(--av-overlay, oklch(0% 0 0deg / 0.72));
  }
  .glightbox-mobile .goverlay {
    background: var(--av-overlay, oklch(0% 0 0deg / 0.72));
  }
  .gslide-inline,
  .gslide-external {
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
  }
  .glightbox-clean .gslide-description {
    background: var(--av-surface-raised);
  }
  .glightbox-clean .gslide-title {
    color: var(--av-text-primary);
  }
  .glightbox-clean .gslide-desc {
    color: var(--av-text-secondary);
  }
  .glightbox-clean .gslide-video {
    background: var(--av-media-well);
  }
  .gclose .garrow,
  .gnext .garrow,
  .gprev .garrow {
    stroke: var(--av-neutral-0);
  }
  .gloader {
    border-color: var(--av-neutral-0);
  }
  /* The vendor paints its focus ring as a fixed navy, which disappears against a
     dark scrim and clashes with every preset. `.gbtn.focused` is its own class,
     set by its own keyboard handling — the ring has to follow the theme or the
     lightbox is the one place in the product where you cannot see where you are. */
  .gbtn.focused {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 2px;
  }
  .glightbox-mobile .glightbox-container .gslide-title {
    color: var(--av-neutral-0);
  }
  .glightbox-mobile .glightbox-container .gslide-desc {
    color: var(--av-neutral-300);
  }
  .glightbox-mobile .glightbox-container .gslide-desc a {
    color: var(--av-neutral-0);
  }
  /* The motion axis switches transitions off product-wide, and a full-screen
     slide is the most noticeable place to miss it. The values are `off` and
     `reduced` — an earlier draft of this rule tested `"none"`, which is not one
     of them and therefore matched nothing.
     `0.01ms` rather than `0`, for the reason utilities/_motion.scss spells out:
     a zero-duration transition never fires `transitionend`, and GLightbox
     finishes its close by waiting for exactly that event. Setting it to none
     here would strand the overlay open — which is the same failure the missing
     stylesheet caused, arrived at from the opposite direction. */
  [data-av-motion=off] .goverlay,
  [data-av-motion=reduced] .goverlay {
    transition-duration: 0.01ms;
  }
}
@layer components {
  .av-lightbox {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-3);
  }
  .av-lightbox__item {
    display: block;
    border-radius: var(--av-radius-md);
    overflow: hidden;
    line-height: 0;
    outline-offset: 2px;
    transition: transform var(--av-duration-fast) var(--av-ease-standard);
  }
  .av-lightbox__item:hover {
    transform: translateY(calc(var(--av-lift, 2px) * -1));
  }
  .av-lightbox__item img {
    display: block;
    inline-size: 160px;
    block-size: 120px;
    object-fit: cover;
  }
}
@layer plugins {
  .filepond--panel-root {
    background-color: var(--av-surface-sunken);
    border: 1px dashed var(--av-border-default);
    border-radius: var(--av-radius-md);
  }
  .filepond--drop-label {
    color: var(--av-text-secondary);
  }
  .filepond--label-action {
    color: var(--av-color-primary-text);
    text-decoration-color: currentColor;
  }
  .filepond--drip-blob {
    background-color: var(--av-text-muted);
  }
  .filepond--item-panel {
    background-color: var(--av-surface-raised);
  }
  .filepond--file {
    color: var(--av-text-primary);
  }
  /* State colours come from the status roles rather than the vendor's own
     green and red, so a preset that shifts what "success" means shifts these
     too — and so the contrast axis reaches them. */
  [data-filepond-item-state=processing-complete] .filepond--item-panel {
    background-color: var(--av-color-success-subtle);
  }
  /* Two selectors, because FilePond has two failure vocabularies and the one
     that matters most is not `error`. A file refused by a validation plugin —
     wrong type, too large, the common case — is `load-invalid`; `*="error"`
     covers only `load-error` and `processing-error`, which are transport
     failures. Styling `error` alone leaves every rejected file painted as
     though it had been accepted, which is exactly what happened here until a
     test pointed at the wrong attribute value and made the gap visible. The
     vendor's own stylesheet carries both, which is the tell. */
  [data-filepond-item-state*=error] .filepond--item-panel,
  [data-filepond-item-state*=invalid] .filepond--item-panel {
    background-color: var(--av-color-danger-subtle);
  }
  /* The action buttons — remove, retry, abort — sit on top of the file row, so
     they are painted against it rather than against the page. The vendor uses a
     half-transparent black, which disappears on a dark row. */
  .filepond--file-action-button {
    color: var(--av-text-on-primary);
    background-color: var(--av-text-muted);
  }
  .filepond--file-action-button:hover {
    background-color: var(--av-text-secondary);
  }
  .filepond--file-action-button[disabled] {
    background-color: var(--av-border-default);
  }
  .filepond--file-action-button:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 2px;
  }
  .filepond--progress-indicator {
    color: var(--av-text-on-primary);
  }
  .filepond--list-scroller::-webkit-scrollbar-thumb {
    background-color: var(--av-border-strong);
  }
  /* The credits link is switched off in the module rather than hidden here — a
     `display: none` on someone's attribution is a licence question, and the
     library's own option is the supported way to decline it. */
}
@layer plugins {
  .leaflet-container {
    background: var(--av-surface-sunken);
    font: inherit;
    color: var(--av-text-primary);
  }
  .leaflet-bar {
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-md);
    box-shadow: var(--av-shadow-sm);
  }
  .leaflet-bar a {
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    border-block-end: 1px solid var(--av-border-subtle);
  }
  .leaflet-bar a:hover {
    background: var(--av-surface-sunken);
  }
  /* Leaflet's controls are anchors, and it paints no focus ring on them. On a
     full-screen map the zoom buttons are the only keyboard targets, so losing
     the ring makes the control unusable without a pointer. */
  .leaflet-bar a:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: -2px;
  }
  .leaflet-bar a.leaflet-disabled {
    background: var(--av-surface-sunken);
    color: var(--av-text-disabled);
  }
  /* `.leaflet-container` in front is not decoration — the vendor writes
     `.leaflet-container .leaflet-control-attribution` at 0-2-0, so a bare
     `.leaflet-control-attribution` loses on specificity no matter which
     stylesheet is later. It left a white slab in the corner of a dark map,
     which is the sort of thing that reads as a rendering fault rather than a
     missing rule. Still inside the 0-3-0 ceiling. */
  .leaflet-container .leaflet-control-attribution {
    background: var(--av-surface-raised);
    color: var(--av-text-muted);
    font-size: var(--av-font-size-2xs);
  }
  .leaflet-container .leaflet-control-attribution a {
    color: var(--av-color-primary-text);
  }
  .leaflet-popup-content-wrapper,
  .leaflet-popup-tip {
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    box-shadow: var(--av-shadow-lg);
  }
  .leaflet-popup-content-wrapper {
    border-radius: var(--av-radius-md);
  }
  .leaflet-container a.leaflet-popup-close-button {
    color: var(--av-text-muted);
  }
}
@layer components {
  /* The map's own box. Height is a custom property rather than a class
     modifier: a map is one of the few components whose height is a per-instance
     decision — a dashboard tile and a full-page locator are the same component
     at very different sizes. */
  .av-map {
    inline-size: 100%;
    block-size: var(--av-map-height, 400px);
    border-radius: var(--av-radius-lg);
    overflow: hidden;
    border: 1px solid var(--av-border-subtle);
  }
  /* The marker. A div rather than Leaflet's default PNG, so it follows the
     preset — a raster pin cannot, and the stock one arrives with a shadow image
     and a retina variant besides. */
  .av-map__pin-dot {
    display: block;
    inline-size: 18px;
    block-size: 18px;
    border-radius: var(--av-radius-full);
    background: var(--av-color-primary);
    border: 3px solid var(--av-surface-raised);
    box-shadow: var(--av-shadow-md);
  }
}
@layer plugins {
  .tabulator {
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-lg);
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
  }
  .tabulator .tabulator-header {
    background: var(--av-surface-sunken);
    border-block-end: 1px solid var(--av-border-default);
    color: var(--av-text-muted);
    font-weight: var(--av-font-weight-semibold);
  }
  .tabulator .tabulator-header .tabulator-col {
    background: transparent;
    border-inline-end: 1px solid var(--av-border-subtle);
  }
  /* 0-5-0, matching the vendor exactly. Tabulator writes this hover at
     `.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover`
     and paints `#cdcdcd` — a light grey flash across the header in dark mode.
     No selector under the usual 0-3-0 ceiling can reach it, which is why
     lint-css raises the ceiling for `plugins/` and only for `plugins/`. */
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover {
    background-color: var(--av-surface-base);
  }
  /* The resize handle is a bare div with no affordance of its own, and the
     vendor tints it with a grey that vanishes on a dark header. */
  .tabulator .tabulator-col-resize-handle:hover {
    background: var(--av-color-primary);
  }
  /* The rows sit on the table element, not on the holder, and the vendor paints
     it `#fff` with `#333` ink. Every row background above is opaque, so this
     only shows through the gaps and below the last row — which is exactly how it
     survived review: a white sliver under a dark grid reads as a border. */
  .tabulator .tabulator-tableholder .tabulator-table {
    background-color: var(--av-surface-raised);
    color: var(--av-text-primary);
  }
  .tabulator .tabulator-row {
    background: var(--av-surface-raised);
  }
  .tabulator .tabulator-row.tabulator-row-even {
    background: var(--av-surface-base);
  }
  .tabulator .tabulator-row:hover {
    background: var(--av-surface-sunken);
  }
  .tabulator .tabulator-row.tabulator-selected {
    background: var(--av-color-primary-subtle);
  }
  .tabulator .tabulator-cell {
    border-inline-end: 1px solid var(--av-border-subtle);
    color: var(--av-text-primary);
  }
  /* Group headers and the calculation rows are the two features Tabulator is
     chosen for, so they get the sunken surface rather than the vendor's grey —
     they have to read as structure rather than as a disabled row. */
  .tabulator .tabulator-row.tabulator-group {
    background: var(--av-surface-sunken);
    border-block: 1px solid var(--av-border-default);
    /* The vendor's `border-right: 1px solid #aaa` is physical, so under RTL it
       paints down the inline *start*. Re-pointing the colour alone would leave
       the rule on the wrong edge; zeroing the start edge and painting the end
       one fixes the side and the colour together. */
    border-inline-end: 1px solid var(--av-border-default);
    border-inline-start: 0;
    color: var(--av-text-primary);
    font-weight: var(--av-font-weight-semibold);
  }
  /* The item count beside a group name. `#d00` is the vendor's, and on any
     surface here it reads as an error rather than as a tally. */
  .tabulator .tabulator-row.tabulator-group span {
    color: var(--av-text-muted);
  }
  .tabulator .tabulator-row.tabulator-calcs {
    font-weight: var(--av-font-weight-semibold);
  }
  /* `background:#e2e2e2!important` — the one vendor declaration in this file
     that no normal declaration can answer at any specificity, because important
     beats normal outright. It needs the vendor's own selector as well as the
     `!important`: `tools/vendor-sync.mjs` wraps the vendored sheet in
     `@layer plugins` too, so both declarations sit in one layer and specificity
     decides between them — 0-5-0 against 0-3-0, which the vendor wins. Matched
     rather than out-specified, since this file loads second and an equal
     selector takes it on order. */
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs {
    background: var(--av-surface-sunken) !important;
  }
  /* The 2px rule separating the totals row is `#aaa` at 0-6-0. */
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom,
  .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top {
    border-block-color: var(--av-border-default);
  }
  .tabulator .tabulator-footer {
    background: var(--av-surface-sunken);
    border-block-start: 1px solid var(--av-border-default);
    color: var(--av-text-muted);
  }
  .tabulator .tabulator-page {
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-sm);
    color: var(--av-text-primary);
  }
  .tabulator .tabulator-page.active {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  .tabulator .tabulator-page:disabled {
    color: var(--av-text-disabled);
  }
  /* Pagination buttons are the grid's only keyboard targets besides the cells,
     and the vendor paints them no ring. */
  .tabulator .tabulator-page:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 2px;
  }
  /* ── Arrows ───────────────────────────────────────────────────────────────
     Every arrow here is a CSS border triangle, so its colour *is* a border
     colour and there is no shorter way to reach it.

     The sort indicator was the reason to look: the vendor paints the idle arrow
     `#bbb` and the active one `#666`, both fixed. On a dark header that makes
     the sorted column's arrow the *dimmer* of the two, so the indicator reads
     backwards — the columns you have not sorted look sorted. Idle takes the
     muted text token and active takes the primary, which keeps the pair the
     right way round in both modes and in every preset.

     These selectors are 0-6-0 and 0-8-0 because the vendor's are — seven
     classes and an attribute — matched rather than escalated, since this sheet
     loads second and an equal selector takes it on order. */
  .tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow,
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    border-block-end-color: var(--av-text-muted);
  }
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    border-block-end-color: var(--av-color-primary);
  }
  .tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
    border-block-start-color: var(--av-color-primary);
    color: var(--av-color-primary);
  }
  /* The group disclosure triangle points along the *inline* axis when collapsed,
     and the vendor builds it from `border-left` — physical, so in RTL it keeps
     pointing right, into the text it is supposed to open. Painting the inline
     end to zero and the inline start solid fixes the direction and the colour in
     one declaration. */
  .tabulator .tabulator-row.tabulator-group .tabulator-arrow {
    border-inline-end: 0;
    border-inline-start: 6px solid var(--av-text-muted);
    margin-inline-end: 16px;
    margin-inline-start: 0;
  }
  /* Expanded, it points down the block axis, and both inline edges go back to
     transparent — the collapsed rule above would otherwise leave a solid wedge
     on one side of the triangle. */
  .tabulator .tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow {
    border-block-start-color: var(--av-text-muted);
    border-inline-end: 6px solid transparent;
    border-inline-start: 6px solid transparent;
    margin-inline-end: 10px;
  }
  .tabulator .tabulator-header-filter input {
    background: var(--av-surface-base);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-sm);
    color: var(--av-text-primary);
  }
  .tabulator .tabulator-edit-list {
    background: var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    box-shadow: var(--av-shadow-lg);
  }
  .tabulator .tabulator-edit-list-item.active {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  .tabulator .tabulator-cell.tabulator-validation-fail {
    border: 1px solid var(--av-color-danger);
    color: var(--av-color-danger-text);
  }
}
@layer plugins {
  /* ── The frame ──────────────────────────────────────────────────────── */
  .av-editor {
    --av-editor-min-height: 240px;
    display: block;
    min-inline-size: 0;
  }
  /* Quill inserts `.ql-toolbar` as a *sibling* immediately before the
     container, not inside it, so the rounded corners have to be split across
     two elements that do not know about each other. */
  .ql-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--av-space-1);
    padding: var(--av-space-2);
    border: 1px solid var(--av-border-default);
    border-start-start-radius: var(--av-radius-md);
    border-start-end-radius: var(--av-radius-md);
    border-end-width: 0;
    background: var(--av-surface-raised);
  }
  .ql-container {
    /* Core sets `Helvetica, Arial, sans-serif` at 13px and `height: 100%`, all
       three of which are wrong here — the last one collapses the editor inside
       an auto-height field. */
    font-family: inherit;
    font-size: var(--av-font-size-sm);
    block-size: auto;
    border: 1px solid var(--av-border-default);
    border-end-start-radius: var(--av-radius-md);
    border-end-end-radius: var(--av-radius-md);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
  }
  /* Focus is shown on the frame. The editing surface is a `contenteditable`
     div, so the browser paints its own outline there and it lands *inside* the
     border — visually detached from the control it belongs to. */
  .ql-container:focus-within {
    border-color: var(--av-color-primary);
    box-shadow: var(--av-focus-ring);
  }
  .ql-editor {
    min-block-size: var(--av-editor-min-height);
    padding: var(--av-space-4);
    line-height: var(--av-line-height-relaxed);
    /* The surface is the one place in this product where prose is authored, so
       it gets prose spacing rather than the reset's zeroed margins. */
  }
  .ql-editor > * + * {
    margin-block-start: var(--av-space-3);
  }
  .ql-editor a {
    color: var(--av-color-primary-text);
  }
  .ql-editor blockquote {
    padding-inline-start: var(--av-space-4);
    border-inline-start: 3px solid var(--av-border-strong);
    color: var(--av-text-secondary);
  }
  .ql-editor pre {
    padding: var(--av-space-3);
    border-radius: var(--av-radius-sm);
    background: var(--av-surface-sunken);
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-xs);
  }
  /* Core paints the placeholder `rgba(0,0,0,0.6)`, which is invisible against a
     dark surface, and pins it with `left`/`right` rather than logical offsets. */
  .ql-editor.ql-blank::before {
    inset-inline: var(--av-space-4);
    inset-inline-end: auto;
    color: var(--av-text-muted);
    font-style: normal;
  }
  /* ── Toolbar controls ───────────────────────────────────────────────── */
  .ql-toolbar button,
  .ql-toolbar .ql-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: auto;
    min-inline-size: 28px;
    block-size: 28px;
    padding: 0 var(--av-space-1);
    border: 0;
    border-radius: var(--av-radius-sm);
    background: none;
    color: var(--av-text-secondary);
    cursor: pointer;
  }
  .ql-toolbar button:hover,
  .ql-toolbar .ql-picker-label:hover {
    background: var(--av-surface-sunken);
    color: var(--av-text-primary);
  }
  .ql-toolbar button:focus-visible,
  .ql-toolbar .ql-picker-label:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: 1px;
  }
  .ql-toolbar button.ql-active,
  .ql-toolbar .ql-picker-label.ql-active {
    background: var(--av-color-primary-subtle);
    color: var(--av-color-primary-text);
  }
  /* Quill's icons are inline SVG whose parts are tagged `.ql-stroke` and
     `.ql-fill` rather than left to `currentColor` — snow paints them `#444`, so
     without this every icon is a dark grey smudge on a dark toolbar. Routing
     both through `currentColor` is what makes the hover and active rules above
     reach the glyph as well as the button. */
  .ql-toolbar .ql-stroke,
  .ql-toolbar .ql-stroke-miter {
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
  }
  .ql-toolbar .ql-fill,
  .ql-toolbar .ql-stroke.ql-fill {
    fill: currentcolor;
  }
  .ql-toolbar .ql-stroke.ql-fill {
    stroke: none;
  }
  /* The `<svg>` root paints no shape of its own, so its `fill` matters only by
     inheritance — and left unset it is the initial `black`, which any path
     Quill draws without a `.ql-stroke`/`.ql-fill` class picks up. The theming
     sweep flags it for exactly that reason, and pointing it at `currentcolor`
     is cheaper and safer than arguing that today's icons all happen to be
     tagged. */
  .ql-toolbar svg {
    inline-size: 18px;
    block-size: 18px;
    fill: currentcolor;
  }
  /* ── Pickers (heading, alignment, colour) ───────────────────────────── */
  .ql-picker {
    position: relative;
    display: inline-flex;
    color: var(--av-text-secondary);
    font-size: var(--av-font-size-sm);
  }
  .ql-picker-label {
    white-space: nowrap;
  }
  /* ── The picker's own text ──────────────────────────────────────────────
     Not decoration, and this is the part of snow that is easiest to leave
     behind: the heading picker's *label* is a `::before` with a literal
     `content`, supplied entirely by the stylesheet. Drop the stylesheet and the
     control renders as a bare 28px dropdown arrow with nothing on it — it still
     opens, it still works, and nobody can tell what it does.
     The `[data-label]` rule is Quill's own escape hatch: it writes the current
     selection's label onto the element, so the closed picker reads "Heading 2"
     rather than always reading "Normal". */
  .ql-picker.ql-header {
    min-inline-size: 104px;
  }
  .ql-picker.ql-header .ql-picker-label::before,
  .ql-picker.ql-header .ql-picker-item::before {
    content: "Normal";
  }
  .ql-picker.ql-header [data-value="1"]::before {
    content: "Heading 1";
  }
  .ql-picker.ql-header [data-value="2"]::before {
    content: "Heading 2";
  }
  .ql-picker.ql-header [data-value="3"]::before {
    content: "Heading 3";
  }
  .ql-picker.ql-header [data-value="4"]::before {
    content: "Heading 4";
  }
  .ql-picker.ql-header [data-value="5"]::before {
    content: "Heading 5";
  }
  .ql-picker.ql-header [data-value="6"]::before {
    content: "Heading 6";
  }
  .ql-picker.ql-header [data-label]:not([data-label=""])::before {
    content: attr(data-label);
  }
  /* The menu previews the size it applies. A list of six identical rows reading
     "Heading 1…6" tells you the name and not the effect. */
  .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
    font-size: 1.6em;
  }
  .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
    font-size: 1.35em;
  }
  .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
    font-size: 1.15em;
  }
  /* The alignment picker is icons rather than text, so it needs the opposite
     treatment: no generated content, and a width that fits a glyph. */
  .ql-picker.ql-align .ql-picker-label::before,
  .ql-picker.ql-align .ql-picker-item::before {
    content: none;
  }
  .ql-picker-options {
    position: absolute;
    inset-block-start: 100%;
    inset-inline-start: 0;
    display: none;
    min-inline-size: 140px;
    margin-block-start: var(--av-space-1);
    padding: var(--av-space-1);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-overlay);
    box-shadow: var(--av-shadow-lg);
    /* A toolbar in a card is inside a stacking context, and a numeric value
       here is what the coding standards forbid for exactly that reason. */
    z-index: var(--av-z-popover);
  }
  .ql-picker.ql-expanded .ql-picker-options {
    display: block;
  }
  .ql-picker-item {
    display: block;
    padding: var(--av-space-1) var(--av-space-2);
    border-radius: var(--av-radius-sm);
    color: var(--av-text-primary);
    cursor: pointer;
  }
  .ql-picker-item:hover {
    background: var(--av-surface-sunken);
  }
  .ql-picker-item.ql-selected {
    color: var(--av-color-primary-text);
  }
  /* The colour picker is a swatch grid, not a list, and its items carry their
     own inline `background-color` — the one place a literal is correct, because
     it is the value being chosen rather than a value being themed. */
  .ql-color-picker .ql-picker-options {
    inline-size: 168px;
    padding: var(--av-space-2);
  }
  .ql-color-picker .ql-picker-item {
    display: inline-block;
    inline-size: 20px;
    block-size: 20px;
    margin: 2px;
    padding: 0;
    border: 1px solid var(--av-border-subtle);
  }
  /* ── Link tooltip ───────────────────────────────────────────────────── */
  .ql-tooltip {
    position: absolute;
    display: flex;
    gap: var(--av-space-2);
    align-items: center;
    padding: var(--av-space-2) var(--av-space-3);
    border: 1px solid var(--av-border-subtle);
    border-radius: var(--av-radius-md);
    background: var(--av-surface-overlay);
    box-shadow: var(--av-shadow-lg);
    color: var(--av-text-primary);
    font-size: var(--av-font-size-sm);
    white-space: nowrap;
    z-index: var(--av-z-popover);
  }
  .ql-tooltip.ql-hidden {
    display: none;
  }
  .ql-tooltip input[type=text] {
    min-inline-size: 220px;
    padding: var(--av-space-1) var(--av-space-2);
    border: 1px solid var(--av-border-default);
    border-radius: var(--av-radius-sm);
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    font: inherit;
  }
  .ql-tooltip a {
    color: var(--av-color-primary-text);
    cursor: pointer;
  }
  .ql-tooltip .ql-preview {
    max-inline-size: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* ── Read-only ──────────────────────────────────────────────────────── */
  .ql-container.ql-disabled {
    background: var(--av-surface-sunken);
  }
  .ql-container.ql-disabled .ql-editor {
    color: var(--av-text-muted);
  }
  /* The character counter's over-limit state. Quill enforces nothing itself —
     the count is advisory here and the server is the authority, which is the
     same division the uploader's size rule follows. */
  .av-counter.is-over {
    color: var(--av-color-danger-text);
    font-weight: 600;
  }
}
@layer styles {
  :where(:root[data-av-style=clean], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=aurora], [data-av-preset=material]), :root:where(:not([data-av-style]), [data-av-style=auto]):not([data-av-preset])) .av-menu__item--active > .av-menu__link {
    box-shadow: none;
  }
  :where(:root[data-av-style=clean], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=aurora], [data-av-preset=material]), :root:where(:not([data-av-style]), [data-av-style=auto]):not([data-av-preset])) .av-btn--primary:not(.av-sidebar *) {
    box-shadow: 0 1px 2px oklch(var(--av-shadow-color)/0.2);
  }
  :where(:root[data-av-style=clean], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=aurora], [data-av-preset=material]), :root:where(:not([data-av-style]), [data-av-style=auto]):not([data-av-preset])) .av-page-header__title {
    letter-spacing: -0.02em;
  }
  :where(:root[data-av-style=clean], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=aurora], [data-av-preset=material]), :root:where(:not([data-av-style]), [data-av-style=auto]):not([data-av-preset])) .av-stat-card:where(:not(.av-stat-card--vivid)):hover {
    translate: none;
  }
}
@layer styles {
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-kanban__column {
    background: transparent;
    border-width: 3px 0 0;
    border-color: var(--av-text-primary);
    border-radius: 0;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card) {
    border: 1px solid var(--av-border-default);
    box-shadow: none;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-card__header {
    border-block-end: 1px solid var(--av-border-default);
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-card__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: -0.005em;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-card--interactive:hover {
    translate: none;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-page-header__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-4xl);
    font-weight: 500;
    letter-spacing: -0.02em;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-page-header__subtitle {
    font-style: italic;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-stat-card:where(:not(.av-stat-card--vivid)) {
    background: transparent;
    border: 0;
    border-block-start: 3px solid var(--av-text-primary);
    border-radius: 0;
    box-shadow: none;
    padding-inline: 0;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    content: none;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-stat-card:where(:not(.av-stat-card--vivid)):hover {
    translate: none;
    box-shadow: none;
    border-color: var(--av-stat-tone);
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-stat-card:where(:not(.av-stat-card--vivid)) .av-stat-card__icon {
    display: none;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-stat-card__label {
    font-variant-caps: all-small-caps;
    letter-spacing: 0.08em;
    font-size: var(--av-font-size-sm);
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-stat-card__value {
    font-family: var(--av-font-display);
    font-weight: 500;
    font-size: var(--av-font-size-4xl);
    letter-spacing: -0.02em;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) :is(.av-table thead th, .av-badge) {
    font-variant-caps: all-small-caps;
    letter-spacing: 0.06em;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-table thead th {
    background: transparent;
    border-block-end: 2px solid var(--av-text-primary);
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-btn {
    border-radius: var(--av-radius-sm);
    letter-spacing: 0.01em;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-btn--primary:not(.av-sidebar *) {
    box-shadow: none;
    background: var(--av-color-primary);
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-btn--primary:not(.av-sidebar *)::after {
    content: none;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-badge {
    background: transparent;
    border: 1px solid currentColor;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-menu__item--active > .av-menu__link {
    box-shadow: none;
  }
  :where(:root[data-av-style=editorial], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=heritage], [data-av-preset=paper], [data-av-preset=sand], [data-av-preset=midnight])) .av-topbar {
    box-shadow: 0 1px 0 var(--av-border-default);
  }
}
@layer styles {
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-kanban__column {
    border: 0;
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-shell {
    background-color: var(--av-surface-sunken);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid)), .av-topbar, .av-dropdown__menu, .av-dialog__inner, .av-toast) {
    background: var(--av-surface-sunken);
    border-color: transparent;
    box-shadow: var(--av-shadow-md);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-main {
    gap: var(--av-space-4);
    padding-inline-end: var(--av-space-4);
    overflow: clip;
    overflow-clip-margin: 1.5rem;
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-topbar {
    backdrop-filter: none;
    border: 0;
    border-radius: var(--av-radius-xl);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-card__header {
    border-block-end: 0;
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-shell {
    padding: var(--av-space-4) 0 var(--av-space-4) var(--av-space-4);
    gap: var(--av-space-4);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-sidebar {
    border: 0;
    border-radius: var(--av-radius-2xl);
    box-shadow: var(--av-shadow-md);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-sidebar__brand {
    border-block-end: 0;
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-menu__link {
    border-radius: var(--av-radius-full);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-menu__item--active > .av-menu__link {
    box-shadow: var(--av-shadow-xs);
    font-weight: var(--av-font-weight-semibold);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-stat-card--hero {
    --av-stat-ink: var(--av-text-primary);
    background: var(--av-surface-sunken);
    color: var(--av-stat-ink);
    box-shadow: var(--av-shadow-lg);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-stat-card--hero .av-stat-card__spark {
    filter: none;
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-stat-card--hero .av-stat-card__icon {
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
    color: var(--av-text-link);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    content: none;
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-stat-card:where(:not(.av-stat-card--vivid)) .av-stat-card__icon {
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-stat-card:where(:not(.av-stat-card--vivid)):hover {
    box-shadow: var(--av-shadow-lg);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) :is(.av-input, .av-select, .av-textarea, .av-search-trigger) {
    background: var(--av-surface-sunken);
    border-color: var(--av-border-default);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) :is(.av-input, .av-select, .av-textarea):focus-visible {
    box-shadow: var(--av-shadow-inner), var(--av-focus-ring);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) :is(.av-btn, .av-input, .av-select, .av-search-trigger) {
    border-radius: var(--av-radius-full);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-btn--primary:not(.av-sidebar *) {
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-btn--primary:not(.av-sidebar *)::after {
    content: none;
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-btn--outline {
    background: var(--av-surface-sunken);
    border-color: var(--av-border-default);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-btn:is(.av-btn--outline, .av-btn--primary):active {
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-progress {
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-badge {
    box-shadow: var(--av-shadow-xs);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-table thead th {
    background: var(--av-surface-sunken);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-segmented {
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-footer {
    background: var(--av-surface-sunken);
    border-block-start-color: transparent;
  }
  @media (max-width: 991.98px) {
    :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-shell {
      padding: 0;
      gap: 0;
    }
    :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-main {
      gap: 0;
      padding-inline-end: 0;
    }
    :where(:root[data-av-style=soft], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=frost], [data-av-preset=sage])) .av-topbar {
      border-radius: 0;
    }
  }
}
@layer styles {
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-kanban__column {
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid)), .av-dropdown__menu, .av-dialog__inner, .av-toast) {
    background: linear-gradient(180deg, color-mix(in oklab, var(--av-surface-raised) 92%, var(--av-neutral-0)) 0%, var(--av-surface-raised) 60%) var(--av-surface-raised);
    border: 1px solid var(--av-border-subtle);
    box-shadow: var(--av-shadow-md);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-card__header {
    border-block-end: 1px solid var(--av-border-subtle);
    box-shadow: 0 1px 0 oklch(var(--av-highlight-color)/0.06);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-card__title, :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-stat-card__label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-stat-card__value {
    font-family: var(--av-font-mono);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: -0.02em;
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    content: none;
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-stat-card:where(:not(.av-stat-card--vivid)) .av-stat-card__icon {
    border-radius: var(--av-radius-full);
    background: radial-gradient(circle at 50% 35%, color-mix(in oklab, var(--av-stat-tone) 35%, var(--av-surface-raised)) 0%, var(--av-surface-sunken) 72%);
    box-shadow: var(--av-shadow-inner), 0 0 14px -2px color-mix(in oklab, var(--av-stat-tone) 50%, transparent);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) :is(.av-input, .av-select, .av-textarea, .av-search-trigger) {
    background: var(--av-surface-sunken);
    border-color: var(--av-border-default);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) :is(.av-input, .av-select, .av-textarea):focus-visible {
    box-shadow: var(--av-shadow-inner), 0 0 0 2px var(--av-color-primary), 0 0 16px -2px color-mix(in oklab, var(--av-color-primary) 60%, transparent);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-btn {
    border-radius: var(--av-radius-full);
    font-weight: var(--av-font-weight-semibold);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-btn--primary:not(.av-sidebar *) {
    box-shadow: inset 0 1px 0 oklch(var(--av-highlight-color)/0.35), inset 0 -2px 0 oklch(var(--av-shadow-color)/0.25), 0 0 20px -4px color-mix(in oklab, var(--av-color-primary) 70%, transparent);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-btn--primary:not(.av-sidebar *):active {
    box-shadow: inset 0 2px 5px oklch(var(--av-shadow-color)/0.45);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-btn--outline {
    background: linear-gradient(180deg, var(--av-surface-raised), var(--av-surface-sunken));
    box-shadow: var(--av-shadow-xs);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-menu__item--active > .av-menu__link {
    background: var(--av-sidebar-active-bg);
    box-shadow: inset 0 2px 4px oklch(var(--av-shadow-color)/0.45), inset 0 -1px 0 oklch(var(--av-highlight-color)/0.06);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-menu__item--active > .av-menu__link::before {
    box-shadow: 0 0 10px var(--av-sidebar-marker);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-progress {
    background: var(--av-surface-sunken);
    box-shadow: var(--av-shadow-inner);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-progress__bar {
    box-shadow: 0 0 10px color-mix(in oklab, var(--av-color-primary) 60%, transparent);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-switch input:checked {
    box-shadow: 0 0 12px -2px color-mix(in oklab, var(--av-color-primary) 70%, transparent);
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-badge {
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-table thead th {
    background: var(--av-surface-sunken);
    letter-spacing: 0.08em;
  }
  :where(:root[data-av-style=tactile], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=pine], [data-av-preset=tidewater], [data-av-preset=ocean], [data-av-preset=harbour])) .av-page-header__title {
    letter-spacing: -0.01em;
  }
}
@layer styles {
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card {
    --av-stat-fill: oklch(from var(--av-stat-tone) min(l, .42) c h);
    --av-stat-ink: var(--av-neutral-0);
    background: linear-gradient(135deg, oklch(from var(--av-stat-fill) calc(l + 0.04) c h) 0%, var(--av-stat-fill) 55%, oklch(from var(--av-stat-fill) calc(l - 0.04) c h) 100%);
    border-color: transparent;
    color: var(--av-stat-ink);
  }
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card::before {
    content: none;
  }
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card :is(.av-stat-card__label, .av-stat-card__value, .av-stat-card__foot, .av-trend) {
    color: inherit;
  }
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card :is(.av-stat-card__label, .av-stat-card__foot) {
    opacity: 0.85;
  }
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card .av-stat-card__spark {
    filter: brightness(0) invert(1);
  }
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card .av-stat-card__icon {
    background: oklch(from var(--av-stat-ink) l c h/0.16);
    color: inherit;
  }
  :where(:root[data-av-style=bold]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel]):not([data-av-depth=plain])) .av-stat-card:where(:not(.av-stat-card--vivid)) {
    box-shadow: var(--av-shadow-md), 0 16px 36px -16px oklch(from var(--av-stat-fill) l c h/0.6);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-kanban__column {
    border: 0;
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card) {
    border: 0;
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-card__header {
    border-block-end: 0;
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-card__title {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--av-font-size-sm);
    font-weight: 800;
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-page-header__title {
    font-size: var(--av-font-size-4xl);
    font-weight: 800;
    letter-spacing: var(--av-tracking-tight);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-stat-card__value {
    font-weight: 800;
    font-size: var(--av-font-size-4xl);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-btn {
    font-weight: var(--av-font-weight-bold);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-btn--primary:not(.av-sidebar *) {
    background: linear-gradient(135deg, var(--av-color-primary) 0%, color-mix(in oklab, var(--av-color-primary) 70%, var(--av-accent-500)) 100%);
    box-shadow: 0 10px 24px -10px color-mix(in oklab, var(--av-color-primary) 80%, transparent);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-badge {
    font-weight: 800;
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-table thead th {
    background: var(--av-color-primary);
    color: var(--av-text-on-primary);
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-menu__item--active > .av-menu__link {
    font-weight: 800;
  }
  :where(:root[data-av-style=bold], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=jewel])) .av-progress {
    block-size: var(--av-space-2-5);
  }
}
@layer styles {
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-shell {
    position: relative;
    isolation: isolate;
    padding: var(--av-space-3);
    gap: 0;
    background-attachment: fixed;
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-shell::before {
    content: "";
    position: absolute;
    inset: var(--av-space-3);
    z-index: var(--av-z-below);
    border: 1px solid var(--av-glass-border);
    border-radius: var(--av-radius-2xl);
    background: color-mix(in oklab, var(--av-surface-raised) 30%, transparent);
    box-shadow: var(--av-shadow-lg);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-main {
    overflow: hidden;
    border-start-end-radius: var(--av-radius-2xl);
    border-end-end-radius: var(--av-radius-2xl);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-sidebar {
    border: 0;
    border-inline-end: 1px solid var(--av-glass-border);
    border-start-start-radius: var(--av-radius-2xl);
    border-end-start-radius: var(--av-radius-2xl);
    box-shadow: none;
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-sidebar__brand {
    border-block-end-color: var(--av-glass-border);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-topbar {
    background: color-mix(in oklab, var(--av-surface-raised) 12%, transparent);
    border-block-end-color: var(--av-glass-border);
    box-shadow: none;
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-footer {
    background: color-mix(in oklab, var(--av-surface-raised) 12%, transparent);
    border-block-start-color: var(--av-glass-border);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) :is(.av-card, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid)), .av-panel) {
    background: var(--av-glass-bg);
    border: 1px solid var(--av-glass-border);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-kanban__column {
    background: color-mix(in oklab, var(--av-surface-sunken) 40%, transparent);
    border-color: var(--av-glass-border);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-card__header {
    border-block-end-color: var(--av-glass-border);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) :is(.av-dropdown__menu, .av-dialog__inner, .av-toast) {
    background: color-mix(in oklab, var(--av-surface-raised) 86%, transparent);
    border: 1px solid var(--av-glass-border);
    box-shadow: var(--av-shadow-lg);
  }
  @supports (backdrop-filter: blur(1px)) {
    :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-shell::before {
      backdrop-filter: blur(calc(var(--av-glass-blur) * 1.4)) saturate(170%);
    }
    :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) :is(.av-card, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid)), .av-panel, .av-dropdown__menu, .av-dialog__inner, .av-toast) {
      backdrop-filter: blur(var(--av-glass-blur)) saturate(150%);
    }
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-stat-card--hero {
    border: 1px solid color-mix(in oklab, var(--av-accent-500) 70%, transparent);
    box-shadow: inset 0 1px 0 oklch(var(--av-highlight-color)/0.2), 0 18px 44px -18px color-mix(in oklab, var(--av-accent-500) 70%, transparent);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-menu__link {
    border-radius: var(--av-radius-md);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-menu__item--active > .av-menu__link {
    box-shadow: 0 8px 18px -8px color-mix(in oklab, var(--av-color-primary) 80%, transparent);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) :is(.av-input, .av-select, .av-textarea, .av-search-trigger, .av-btn--outline) {
    background: color-mix(in oklab, var(--av-surface-raised) 44%, transparent);
    border-color: var(--av-glass-border);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-btn--primary:not(.av-sidebar *) {
    box-shadow: 0 10px 22px -12px color-mix(in oklab, var(--av-color-primary) 85%, transparent);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-table thead th {
    background: color-mix(in oklab, var(--av-surface-sunken) 50%, transparent);
  }
  :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-page-header__title {
    font-weight: var(--av-font-weight-bold);
    letter-spacing: var(--av-tracking-tight);
  }
  @media (max-width: 991.98px) {
    :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-shell {
      padding: 0;
    }
    :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-shell::before {
      inset: 0;
      border: 0;
      border-radius: 0;
    }
    :where(:root[data-av-style=glass], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=oxford], [data-av-preset=neon], [data-av-preset=grape])) .av-main {
      border-radius: 0;
    }
  }
}
@layer styles {
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-kanban__column {
    border: var(--av-ink-line);
    background: var(--av-surface-sunken);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) {
    --av-ink-line: 2px solid var(--av-text-primary);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-shell {
    background-image: radial-gradient(oklch(var(--av-shadow-color)/0.16) 1px, transparent 1px);
    background-size: 18px 18px;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) :is(.av-card, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid)), .av-panel, .av-dropdown__menu, .av-dialog__inner, .av-toast) {
    border: var(--av-ink-line);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-card__header {
    border-block-end: var(--av-ink-line);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) :is(.av-card--interactive, .av-stat-card:where(:not(.av-stat-card--vivid))):hover {
    translate: var(--av-lift) var(--av-lift);
    box-shadow: var(--av-shadow-md);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-sidebar {
    border-inline-end: var(--av-ink-line);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-sidebar__brand {
    border-block-end: var(--av-ink-line);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-topbar {
    border-block-end: var(--av-ink-line);
    box-shadow: none;
    backdrop-filter: none;
    background: var(--av-surface-raised);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-menu__item--active > .av-menu__link {
    background: var(--av-surface-raised);
    color: var(--av-text-primary);
    border: var(--av-ink-line);
    box-shadow: var(--av-shadow-xs);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-menu__item--active > .av-menu__link::before {
    content: none;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) :is(.av-page-header__title, .av-card__title, .av-section__title) {
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: var(--av-font-weight-bold);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-page-header__title {
    font-size: var(--av-font-size-3xl);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) :is(.av-stat-card__label, .av-table thead th, .av-badge) {
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-stat-card__value {
    font-family: var(--av-font-mono);
    font-weight: var(--av-font-weight-bold);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-stat-card:where(:not(.av-stat-card--vivid)) .av-stat-card__icon {
    border: var(--av-ink-line);
    border-radius: 0;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-btn {
    border: var(--av-ink-line);
    box-shadow: var(--av-shadow-xs);
    font-weight: var(--av-font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: translate var(--av-duration-fastest) var(--av-ease-standard), box-shadow var(--av-duration-fastest) var(--av-ease-standard);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-btn--primary:not(.av-sidebar *) {
    background: var(--av-color-primary);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-btn--primary:not(.av-sidebar *)::after {
    content: none;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-btn--ghost {
    border-color: transparent;
    box-shadow: none;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-btn:not(.av-btn--ghost):hover {
    translate: var(--av-lift-sm) var(--av-lift-sm);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-btn:not(.av-btn--ghost):active {
    translate: calc(var(--av-lift) * -1) calc(var(--av-lift) * -1);
    box-shadow: none;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) :is(.av-input, .av-select, .av-textarea, .av-search-trigger) {
    border: var(--av-ink-line);
    background: var(--av-surface-raised);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) :is(.av-input, .av-select, .av-textarea):focus-visible {
    box-shadow: var(--av-shadow-xs);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-badge {
    border: var(--av-ink-line);
    border-radius: 0;
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-table thead th {
    background: var(--av-text-primary);
    color: var(--av-surface-raised);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-table td {
    border-block-end: 1px solid var(--av-text-primary);
  }
  :where(:root[data-av-style=brutal], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=granite], [data-av-preset=graphite], [data-av-preset=mono], [data-av-preset=github], [data-av-preset=carbon])) .av-progress {
    border: var(--av-ink-line);
    border-radius: 0;
  }
}
@layer styles {
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-kanban__column {
    border: 0;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card) {
    --av-card-padding: var(--av-space-6);
    border: 1px solid var(--av-border-subtle);
    box-shadow: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-card__header {
    border-block-end: 0;
    padding-block-end: 0;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) :is(.av-card--interactive, .av-stat-card:where(:not(.av-stat-card--vivid))):hover {
    translate: none;
    box-shadow: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-stat-card:where(:not(.av-stat-card--vivid)) {
    border: 0;
    box-shadow: none;
    background: color-mix(in oklab, var(--av-stat-tone) 8%, var(--av-surface-raised));
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    content: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-stat-card:where(:not(.av-stat-card--vivid)) .av-stat-card__icon {
    background: transparent;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-topbar {
    background: var(--av-surface-base);
    backdrop-filter: none;
    box-shadow: none;
    border-block-end-color: transparent;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-btn--primary:not(.av-sidebar *) {
    background: var(--av-color-primary);
    box-shadow: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-btn--primary:not(.av-sidebar *)::after {
    content: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-btn--outline {
    box-shadow: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-menu__item--active > .av-menu__link {
    background-image: none;
    box-shadow: none;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) :is(.av-input, .av-select, .av-textarea) {
    background: var(--av-surface-raised);
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-table thead th {
    background: transparent;
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-table td {
    border-block-end-color: var(--av-border-subtle);
  }
  :where(:root[data-av-style=flat], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=urbanite], [data-av-preset=arctic], [data-av-preset=slate], [data-av-preset=nord])) .av-page-header__title {
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: -0.02em;
  }
}
@layer styles {
  :where(:root[data-av-style=luxe]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm]):not([data-av-depth=plain])) .av-stat-card:where(:not(.av-stat-card--vivid)) {
    border: 1px solid var(--av-border-default);
    box-shadow: inset 0 0 0 4px var(--av-surface-raised), inset 0 0 0 5px color-mix(in oklab, var(--av-accent-500) 30%, transparent), var(--av-shadow-sm);
  }
  :where(:root[data-av-style=luxe]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm]):not([data-av-depth=plain])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    content: none;
  }
  :where(:root[data-av-style=luxe]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm]):not([data-av-depth=plain])) .av-stat-card__value {
    font-family: var(--av-font-display);
    font-weight: 500;
  }
  :where(:root[data-av-style=luxe]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm]):not([data-av-depth=plain])) .av-stat-card--hero {
    --av-stat-ink: var(--av-neutral-950);
    --av-stat-leaf: var(--av-metal, var(--av-accent-500));
    background: linear-gradient(125deg, var(--av-stat-leaf) 0%, oklch(from var(--av-stat-leaf) calc(l + 0.1) calc(c * 0.8) h) 38%, var(--av-stat-leaf) 62%, oklch(from var(--av-stat-leaf) calc(l + 0.12) calc(c * 0.7) h) 100%) var(--av-stat-leaf);
    border-color: color-mix(in oklab, var(--av-stat-leaf) 60%, transparent);
    color: var(--av-stat-ink);
  }
  :where(:root[data-av-style=luxe]:not([data-av-depth=plain]), :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm]):not([data-av-depth=plain])) .av-stat-card--hero .av-stat-card__spark {
    filter: brightness(0);
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-kanban__column {
    border-color: color-mix(in oklab, var(--av-accent-500) 30%, var(--av-border-subtle));
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card) {
    border: 1px solid var(--av-border-default);
    box-shadow: inset 0 0 0 4px var(--av-surface-raised), inset 0 0 0 5px color-mix(in oklab, var(--av-accent-500) 22%, transparent), var(--av-shadow-sm);
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-card__header {
    border-block-end: 1px solid color-mix(in oklab, var(--av-accent-500) 35%, var(--av-border-subtle));
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-card__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-lg);
    font-weight: var(--av-font-weight-semibold);
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-page-header__title {
    font-family: var(--av-font-display);
    font-size: var(--av-font-size-4xl);
    font-weight: 500;
    letter-spacing: -0.015em;
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-btn {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: var(--av-font-size-xs);
    font-weight: var(--av-font-weight-semibold);
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-btn--primary:not(.av-sidebar *) {
    background: var(--av-color-primary);
    border: 1px solid color-mix(in oklab, var(--av-accent-500) 60%, transparent);
    box-shadow: inset 0 1px 0 oklch(var(--av-highlight-color)/0.12), var(--av-shadow-sm);
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-btn--primary:not(.av-sidebar *)::after {
    content: none;
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-btn--outline {
    border-color: color-mix(in oklab, var(--av-accent-500) 55%, var(--av-border-default));
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-menu__item--active > .av-menu__link {
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--av-accent-500) 45%, transparent);
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-table thead th {
    background: transparent;
    border-block-end: 1px solid color-mix(in oklab, var(--av-accent-500) 45%, var(--av-border-default));
    letter-spacing: 0.1em;
  }
  :where(:root[data-av-style=luxe], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=storm])) .av-badge {
    letter-spacing: 0.06em;
  }
}
@layer styles {
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card, .av-stat-card, .av-dialog__inner) {
    border-start-start-radius: var(--av-radius-2xl);
    border-end-end-radius: var(--av-radius-2xl);
    border-start-end-radius: var(--av-radius-sm);
    border-end-start-radius: var(--av-radius-sm);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card) {
    border-color: color-mix(in oklab, var(--av-color-primary) 14%, var(--av-border-subtle));
    background: linear-gradient(160deg, var(--av-surface-raised) 40%, color-mix(in oklab, var(--av-color-primary) 7%, var(--av-surface-raised)) 100%) var(--av-surface-raised);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-kanban__column {
    border-color: color-mix(in oklab, var(--av-color-primary) 14%, var(--av-border-subtle));
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-card__header {
    border-block-end: 0;
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-card__title {
    font-weight: var(--av-font-weight-bold);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-page-header__title {
    font-size: var(--av-font-size-4xl);
    font-weight: 800;
    letter-spacing: var(--av-tracking-tight);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-stat-card:where(:not(.av-stat-card--vivid)) {
    background: radial-gradient(ellipse 85% 110% at 0% 0%, color-mix(in oklab, var(--av-stat-tone) 20%, transparent) 0%, transparent 70%) var(--av-surface-raised);
    border-color: color-mix(in oklab, var(--av-stat-tone) 18%, var(--av-border-subtle));
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-stat-card__icon {
    border-start-start-radius: var(--av-radius-full);
    border-end-end-radius: var(--av-radius-full);
    border-start-end-radius: var(--av-radius-sm);
    border-end-start-radius: var(--av-radius-sm);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) :is(.av-btn, .av-badge, .av-input, .av-select, .av-search-trigger) {
    border-radius: var(--av-radius-full);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-btn--primary:not(.av-sidebar *) {
    background: linear-gradient(135deg, color-mix(in oklab, var(--av-color-primary) 88%, var(--av-accent-500)), var(--av-color-primary));
    box-shadow: 0 10px 22px -12px color-mix(in oklab, var(--av-color-primary) 80%, transparent);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-menu__item--active > .av-menu__link {
    border-start-start-radius: var(--av-radius-xl);
    border-end-end-radius: var(--av-radius-xl);
    border-start-end-radius: var(--av-radius-xs);
    border-end-start-radius: var(--av-radius-xs);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-table thead th {
    background: color-mix(in oklab, var(--av-color-primary) 8%, transparent);
  }
  :where(:root[data-av-style=organic], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=matsuba], [data-av-preset=evergreen], [data-av-preset=forest])) .av-progress {
    block-size: var(--av-space-2-5);
  }
}
@layer styles {
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid))) {
    --av-blueprint-ink: color-mix(in oklab, var(--av-color-primary) 60%, var(--av-border-default));
    border: 1px solid var(--av-border-default);
    box-shadow: none;
    background: linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 0 0/14px 2px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 0 0/2px 14px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 100% 0/14px 2px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 100% 0/2px 14px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 0 100%/14px 2px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 0 100%/2px 14px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 100% 100%/14px 2px no-repeat, linear-gradient(var(--av-blueprint-ink), var(--av-blueprint-ink)) 100% 100%/2px 14px no-repeat, var(--av-surface-raised);
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    content: none;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-kanban__column {
    border-style: dashed;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-card__header {
    border-block-end: 1px dashed var(--av-border-default);
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) :is(.av-card__title, .av-stat-card__label, .av-btn, .av-badge, .av-table thead th) {
    font-family: var(--av-font-mono);
    font-size: var(--av-font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-page-header__title {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: var(--av-font-weight-semibold);
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-stat-card__value {
    font-family: var(--av-font-mono);
    font-weight: var(--av-font-weight-medium);
    letter-spacing: 0;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-stat-card__icon {
    border: 1px solid currentColor;
    background: transparent;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-btn--primary:not(.av-sidebar *)::after {
    content: none;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-btn--outline {
    border-style: dashed;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-table thead th {
    background: transparent;
    border-block-end: 1px solid color-mix(in oklab, var(--av-color-primary) 60%, var(--av-border-default));
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-table td {
    border-block-end-style: dashed;
  }
  :where(:root[data-av-style=blueprint], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=deepsea])) .av-menu__item--active > .av-menu__link {
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--av-sidebar-marker) 55%, transparent);
  }
}
@layer styles {
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid))) {
    border: 1px solid transparent;
    background: linear-gradient(var(--av-surface-raised), var(--av-surface-raised)) padding-box, linear-gradient(135deg, var(--av-accent-500) 0%, color-mix(in oklab, var(--av-accent-500) 14%, var(--av-border-subtle)) 36%, color-mix(in oklab, var(--av-color-primary) 14%, var(--av-border-subtle)) 64%, var(--av-color-primary) 100%) border-box var(--av-surface-raised);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-stat-card:where(:not(.av-stat-card--vivid))::before {
    background: linear-gradient(90deg, var(--av-stat-tone), var(--av-accent-500));
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-stat-card--hero {
    background: linear-gradient(135deg, oklch(from var(--av-accent-500) min(l, 0.42) c h) 0%, oklch(from var(--av-chart-1) min(l, 0.32) c h) 100%) oklch(from var(--av-accent-500) min(l, 0.42) c h);
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-card__header {
    border-block-end: 0;
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-card__title {
    font-weight: var(--av-font-weight-bold);
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-page-header__title {
    font-size: var(--av-font-size-4xl);
    font-weight: 800;
    letter-spacing: var(--av-tracking-tight);
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-stat-card__value {
    font-weight: 800;
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-btn--primary:not(.av-sidebar *) {
    background: linear-gradient(120deg, var(--av-color-primary) 0%, color-mix(in oklab, var(--av-color-primary) 74%, var(--av-accent-500)) 100%);
    box-shadow: 0 10px 26px -10px color-mix(in oklab, var(--av-accent-500) 70%, transparent);
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-progress__bar {
    background: linear-gradient(90deg, var(--av-color-primary), var(--av-accent-500));
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-table thead th {
    background: transparent;
    border-block-end: 2px solid var(--av-accent-500);
  }
  :where(:root[data-av-style=duotone], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=catawba])) .av-menu__item--active > .av-menu__link {
    box-shadow: inset 0 -2px 0 var(--av-sidebar-marker);
  }
}
@layer styles {
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-shell {
    padding: var(--av-space-3);
    gap: var(--av-space-3);
    background-color: var(--av-surface-sunken);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-main {
    gap: var(--av-space-3);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-sidebar {
    border: 0;
    border-radius: var(--av-radius-xl);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-sidebar__brand {
    border-block-end: 0;
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-topbar {
    border: 0;
    border-radius: var(--av-radius-xl);
    background: var(--av-surface-raised);
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-footer {
    background: transparent;
    border-block-start-color: transparent;
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) :is(.av-card, .av-panel, .av-auth__card, .av-kanban__card, .av-stat-card:where(:not(.av-stat-card--vivid))) {
    border-color: transparent;
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-kanban__column {
    border: 0;
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-card__header {
    border-block-end: 0;
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-card__title {
    font-weight: var(--av-font-weight-bold);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-page-header__title {
    font-size: var(--av-font-size-4xl);
    font-weight: var(--av-font-weight-bold);
    letter-spacing: var(--av-tracking-tight);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-stat-card__value {
    font-weight: var(--av-font-weight-normal);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-stat-card:where(:not(.av-stat-card--vivid)) .av-stat-card__icon {
    border-radius: var(--av-radius-full);
    background: var(--av-surface-sunken);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) :is(.av-btn, .av-badge, .av-input, .av-select, .av-search-trigger, .av-menu__link) {
    border-radius: var(--av-radius-full);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) :is(.av-input, .av-select, .av-textarea, .av-search-trigger) {
    background: var(--av-surface-sunken);
    border-color: transparent;
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-btn--outline {
    background: var(--av-surface-raised);
    border-color: transparent;
    box-shadow: var(--av-shadow-sm);
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-table thead th {
    background: transparent;
  }
  :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-progress {
    block-size: var(--av-space-2-5);
  }
  @media (max-width: 991.98px) {
    :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-shell {
      padding: 0;
      gap: 0;
    }
    :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) .av-main {
      gap: 0;
    }
    :where(:root[data-av-style=bento], :root:where(:not([data-av-style]), [data-av-style=auto]):is([data-av-preset=kuri], [data-av-preset=terracotta], [data-av-preset=ember], [data-av-preset=crimson], [data-av-preset=forge], [data-av-preset=noir])) :is(.av-sidebar, .av-topbar) {
      border-radius: 0;
    }
  }
}
@layer utilities {
  /* Grid helpers ────────────────────────────────────────────────────── */
  .av-grid {
    display: grid;
    gap: var(--av-space-4);
  }
  /* A grid item's automatic minimum size is its content's min-content width, so
     a `1fr` track silently grows past the viewport to fit a wide table instead
     of letting that table scroll inside its own `.av-table-wrap`. The page still
     passes a documentElement overflow check because `.av-content` absorbs the
     excess — it just scrolls sideways. Same reason `.av-main` sets this. */
  .av-grid > * {
    min-inline-size: 0;
  }
  .av-grid--stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  /* A row of four whose first tile leads (`.av-stat-card--hero`): it takes the
     wider track once the other three keep the width they had as equals. */
  @media (min-width: 1400px) {
    .av-grid--lead {
      grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
    }
  }
  /* Two tiles a row on a phone. One a row made a dashboard's four headline
     figures more than two screens tall, which is the opposite of a summary. */
  @media (max-width: 575.98px) {
    .av-grid--stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--av-space-3);
    }
  }
  /* Cards with a picture and a paragraph in them, rather than a figure and a
     label. The wider floor is the whole difference: at the stats track a
     three-line excerpt breaks to six lines and the covers arrive at postage
     stamp size, which is the one thing a feed exists to show. */
  .av-grid--cards {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .av-grid--main {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
  .av-grid--half {
    grid-template-columns: 3fr 2fr;
    align-items: start;
  }
  @media (max-width: 1199.98px) {
    .av-grid--main, .av-grid--half {
      grid-template-columns: 1fr;
    }
  }
  .av-stack-4 > * + * {
    margin-block-start: var(--av-space-4);
  }
  /* The narrow column beside a `.av-grid--main`/`--half` primary: a column of
     cards that must not stretch to the primary's height. `align-items: start`
     on the outer grid already stops the *column* stretching; this stops the
     column's own children spacing out to fill it once it does. */
  .av-aside-stack {
    display: grid;
    gap: var(--av-space-4);
    align-content: start;
  }
  /* And its children need the same guard `.av-grid > *` gets, for the same
     reason: a grid item's automatic minimum size is its content's min-content
     width. A card in this column can hold something wider than the column —
     a search preview clamped to one line, a table — and without this the card
     grows past its own track and out through the side of the page instead of
     letting that content clip or scroll. Found by `tests/pages.mjs` on
     `post.html`: 27px of overflow inside `.av-content`, from a single-line
     search-result title in a 367px column. */
  .av-aside-stack > * {
    min-inline-size: 0;
  }
}
@layer utilities {
  /* Block-direction spacing, and the reason this partial exists.
     97 spacing declarations were written inline across `html/_src` — 45 of them
     `margin-block-start` — against a house rule that forbids inline `style`
     outright. They are not per-instance data: they are the same handful of token
     steps repeated, which is the definition of a modifier rather than a value.

     Only the steps actually used are defined. This is deliberately not a
     complete scale: an unused utility is a name to maintain for nothing, and the
     product's utility layer is small on purpose. Add a step when a page needs
     it, not in anticipation.

     Logical properties throughout, so RTL and vertical writing modes need no
     second rule. */
  .av-mt-0 {
    margin-block-start: 0;
  }
  .av-mt-2 {
    margin-block-start: var(--av-space-2);
  }
  .av-mt-3 {
    margin-block-start: var(--av-space-3);
  }
  .av-mt-4 {
    margin-block-start: var(--av-space-4);
  }
  .av-mt-6 {
    margin-block-start: var(--av-space-6);
  }
  .av-mb-0 {
    margin-block-end: 0;
  }
  .av-mb-2 {
    margin-block-end: var(--av-space-2);
  }
  .av-mb-3 {
    margin-block-end: var(--av-space-3);
  }
  .av-mb-4 {
    margin-block-end: var(--av-space-4);
  }
  .av-mb-5 {
    margin-block-end: var(--av-space-5);
  }
  .av-mb-6 {
    margin-block-end: var(--av-space-6);
  }
  .av-pt-3 {
    padding-block-start: var(--av-space-3);
  }
  .av-pt-4 {
    padding-block-start: var(--av-space-4);
  }
  .av-pt-5 {
    padding-block-start: var(--av-space-5);
  }
}
@layer utilities {
  /* Showcase page helpers ───────────────────────────────────────────── */
  .av-demo-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--av-space-3);
    align-items: center;
  }
  .av-demo-label {
    font-size: var(--av-font-size-2xs);
    font-weight: var(--av-font-weight-semibold);
    letter-spacing: var(--av-tracking-wider);
    text-transform: uppercase;
    color: var(--av-text-muted);
    margin-block: var(--av-space-5) var(--av-space-2);
  }
  .av-demo-label:first-child {
    margin-block-start: 0;
  }
  /* A specimen needs a box to be visible at all — a glass panel or a glow with
     no padding collapses to a hairline. This is deliberately a *demo* helper
     rather than a `.av-p-4` spacing scale: this build has no padding utilities,
     and inventing a public one to prop up a reference page would ship an API
     nothing else uses and nothing documents. */
  .av-demo-pad {
    padding: var(--av-space-4);
  }
  /* A ramp drawn as eleven steps. *Which* ramp is per-instance data and
     arrives as a value custom property; the ink is not. Every ramp in the
     system crosses from dark type to light type at the same step, because the
     steps are generated in OKLCH and 500 is the same perceptual weight in all
     seventeen of them — so the flip is a property of the position, and the
     sixth child is where it belongs. It had been written out thirty-three
     times inline, once per step, which is a rule wearing a disguise. */
  .av-swatch-row {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 2px;
  }
  .av-swatch-row div {
    background: var(--av-swatch, transparent);
    color: var(--av-neutral-900);
    block-size: 44px;
    border-radius: var(--av-radius-xs);
    display: grid;
    place-items: end center;
    padding-block-end: 2px;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
  }
  .av-swatch-row div:nth-child(n+6) {
    color: var(--av-neutral-0);
  }
}
@layer utilities {
  /* Visually hidden */
  .av-visually-hidden {
    position: absolute !important;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
@layer utilities {
  [hidden] {
    display: none;
  }
}
@layer utilities {
  /* Two kill switches, and both belong here rather than in `base` for the same
     reason `[hidden]` does: they are *overrides*, they need `!important` to beat
     a component's own transition, and `utilities` is the only layer where the
     coding standards allow it. Declared in base they were the sole thing in the
     codebase breaking that rule, and they would have lost to any component rule
     that raised its specificity.

     `0.01ms` rather than `0`: a zero-duration animation never fires
     `animationend`, and code waiting on that event would wait for ever. This is
     the canonical form of the reduced-motion reset for exactly that reason. */
  /* Boot and theme-swap suppression (docs/04-theming/01-theme-engine.md). The
     inline boot script adds .av-booting before first paint and takes it off two
     frames later; the runtime adds .av-theming around a preset change. So
     neither the initial render nor a theme swap animates its way in.

     The removal moved into the boot script because `adminvora.js` used to be
     the only thing that did it, and the six error pages deliberately do not
     load the bundle — a 500 that depends on the app bundle fails during the
     outage it exists to report. This rule suppresses *every* transition on the
     page, so on those pages the class would never come off and no hover state
     would ever move. A suppression must not outlive the paint it suppresses,
     and must not depend on a file the page chose not to load. */
  .av-booting, .av-booting *, .av-booting *::before, .av-booting *::after,
  .av-theming, .av-theming *, .av-theming *::before, .av-theming *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
  }
  /* The reduced-motion reset itself, written once. It has two triggers and they
     mean the same thing, so they share one declaration block rather than
     drifting apart:

       1. `prefers-reduced-motion: reduce` — the operating-system preference.
       2. `data-av-motion="reduced"|"off"` — the product's own axis, set by the
          Customizer's "Reduce motion" switch and by the boot script from
          storage. `full` is the default and is read by nothing; the default is
          really the attribute's absence.

     Both are already read as one condition everywhere else: `stillMotion()` in
     the runtime ORs them, `plugins/_glightbox.scss` collapses the overlay for
     either, and the generated token layer zeroes `--av-duration-*` and
     `--av-lift` for either. Which is why the gap this rule closes was so easy
     to miss — the axis *did* stop every tokenised `transition`, because the
     durations it interpolates are tokens. What it never touched was
     `@keyframes`: 34 `animation` declarations carry their own hard-coded
     duration and nearly all of them are `infinite`, so setting the in-app
     control to "Reduce motion" left the skeleton shimmering, the spinners
     spinning and the auth background drifting — the most conspicuous motion in
     the product, and the motion a person reaching for that switch is most
     likely reaching for. The carousel's `scroll-behavior: smooth` was the same
     story one property along.

     The attribute selectors match `<html>` *and* its subtree: the element
     carrying the axis is the scroll container `scroll-behavior` applies to, and
     a descendant-only selector would skip it. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
    }
  }
  :is([data-av-motion=reduced], [data-av-motion=off]), :is([data-av-motion=reduced], [data-av-motion=off]) *, :is([data-av-motion=reduced], [data-av-motion=off]) *::before, :is([data-av-motion=reduced], [data-av-motion=off]) *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
@layer utilities {
  /* Glass — a translucent surface over the ambient mesh.
     `backdrop-filter` only has anything to blur when there is something behind
     it, so a glass panel on a flat background reads as a plain tinted box. Both
     `body` and `.av-shell` paint the mesh for exactly this reason. */
  .av-glass {
    background: var(--av-glass-bg);
    border: 1px solid var(--av-glass-border);
    border-radius: var(--av-radius-lg);
    backdrop-filter: blur(var(--av-glass-blur));
  }
  /* The modifiers scale the blur rather than swapping the tint, because the tint
     is what carries the theme and the blur is what carries the depth. */
  .av-glass--subtle {
    backdrop-filter: blur(calc(var(--av-glass-blur) * 0.5));
  }
  .av-glass--strong {
    backdrop-filter: blur(calc(var(--av-glass-blur) * 1.75));
  }
  /* Gradient text.
     `background-clip: text` needs a transparent fill to show through, and that
     transparency is inherited by anything the element contains — including a
     focus outline, which then disappears. Restrict the clip to the element's own
     text and let descendants opt back into a solid colour. */
  .av-text-gradient {
    background: var(--av-gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Safari paints the selection highlight against the transparent fill and the
       text becomes invisible while selected. */
    -webkit-text-fill-color: transparent;
  }
  /* A gradient cannot paint a border directly: `border-image` does not follow
     `border-radius`, so a rounded gradient border loses its corners. Two
     backgrounds with different `background-clip` values is the technique that
     does — the inner one clips to the padding box, the outer to the border box,
     and the border area is what is left showing. */
  .av-border-gradient {
    --av-border-gradient-width: 1px;
    position: relative;
    background: linear-gradient(var(--av-surface-raised), var(--av-surface-raised)) padding-box, var(--av-gradient-brand) border-box;
    border: var(--av-border-gradient-width) solid transparent;
    border-radius: var(--av-radius-lg);
  }
  /* Glow — a coloured ambient shadow. The role modifiers read the same token set
     the status roles use, so a success glow and a success badge cannot drift. */
  .av-glow {
    box-shadow: var(--av-glow-primary);
  }
  .av-glow--success {
    box-shadow: var(--av-glow-success);
  }
  .av-glow--warning {
    box-shadow: var(--av-glow-warning);
  }
  .av-glow--danger {
    box-shadow: var(--av-glow-danger);
  }
  .av-glow--info {
    box-shadow: var(--av-glow-info);
  }
  /* Grain — a film-grain overlay that breaks up banding in the large gradient
     surfaces (the auth brand panel, the mesh wash). It is an inline SVG
     `feTurbulence` rather than a raster: a tiled PNG is a network request and a
     licence question, and the filter is a few hundred bytes.

     `pointer-events: none` on the pseudo-element is load-bearing — the overlay
     covers the whole box and would otherwise eat every click inside it. */
  .av-grain {
    position: relative;
    isolation: isolate;
  }
  .av-grain::after {
    position: absolute;
    inset: 0;
    z-index: var(--av-z-base);
    pointer-events: none;
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    border-radius: inherit;
    opacity: 0.035;
    mix-blend-mode: overlay;
  }
  /* Lift — the hover rise the cards use, as a utility.
     `--av-lift` is zeroed by the motion axis, so "does this theme move?" stays
     answered in one place and this needs no reduced-motion rule of its own. */
  .av-lift {
    transition: transform var(--av-duration-fast) var(--av-ease-decelerate), box-shadow var(--av-duration-fast) var(--av-ease-decelerate);
  }
  .av-lift:hover {
    box-shadow: var(--av-shadow-lg);
    transform: translateY(calc(var(--av-lift) * -1));
  }
  .av-lift--sm:hover {
    transform: translateY(calc(var(--av-lift-sm) * -1));
  }
  /* Aspect ratio.
     Named `.av-ratio` rather than Bootstrap's `.ratio`: there is no Bootstrap in
     this build, and an unprefixed class in a template someone drops into their
     own project is a collision waiting to happen. */
  .av-ratio {
    --av-ratio: 16 / 9;
    position: relative;
    inline-size: 100%;
    aspect-ratio: var(--av-ratio);
  }
  .av-ratio > * {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  .av-ratio--1x1 {
    --av-ratio: 1;
  }
  .av-ratio--4x3 {
    --av-ratio: 4 / 3;
  }
  .av-ratio--21x9 {
    --av-ratio: 21 / 9;
  }
  /* Scroll reveal.
     The hidden state is applied by JS, never in the stylesheet — a CSS-only
     `opacity: 0` start state hides the content permanently for anyone without
     JavaScript, and an admin template is exactly where that matters. `initReveal`
     adds `data-av-reveal-state="hidden"` and an IntersectionObserver removes it.

     Reduced motion is handled by the global reset in utilities/motion, which
     collapses the duration; the element still ends visible either way. */
  [data-av-reveal] {
    transition: opacity var(--av-duration-slow) var(--av-ease-decelerate), transform var(--av-duration-slow) var(--av-ease-decelerate);
  }
  [data-av-reveal][data-av-reveal-state=hidden] {
    opacity: 0;
    transform: translateY(var(--av-space-4));
  }
  [data-av-reveal=left][data-av-reveal-state=hidden] {
    /* `transform` has no logical form, so the direction travels as a custom
       property that the [dir="rtl"] rule flips — the same tactic the sidebar
       sweep and the auth panel already use. */
    transform: translateX(calc(var(--av-reveal-shift, 1) * var(--av-space-4) * -1));
  }
  [data-av-reveal=right][data-av-reveal-state=hidden] {
    transform: translateX(calc(var(--av-reveal-shift, 1) * var(--av-space-4)));
  }
  [dir=rtl] [data-av-reveal=left],
  [dir=rtl] [data-av-reveal=right] {
    --av-reveal-shift: -1;
  }
}
@layer utilities {
  @media print {
    @page {
      size: A4;
      margin: 15mm;
    }
    /* App chrome has no meaning on paper, and the shell's scroll container
       would otherwise clip the document to one screen's worth of content. */
    .av-sidebar,
    .av-sidebar-backdrop,
    .av-topbar,
    .av-footer,
    .av-customizer,
    .av-customizer-trigger,
    .av-page-header__actions,
    .av-breadcrumb,
    [data-av-print-hide] {
      display: none !important;
    }
    .av-shell {
      display: block !important;
      block-size: auto !important;
    }
    .av-main,
    .av-content {
      display: block !important;
      overflow: visible !important;
      block-size: auto !important;
    }
    .av-content > .container-fluid {
      padding: 0 !important;
      max-inline-size: none !important;
    }
    /* Print in the light palette whatever the screen was set to: a dark
       surface costs a page of toner and reads worse. */
    body {
      background: #fff !important;
      color: #000 !important;
    }
    .av-card {
      box-shadow: none !important;
      border: 1px solid #ddd !important;
      break-inside: avoid;
    }
    .av-table {
      break-inside: auto;
    }
    .av-table thead {
      display: table-header-group;
    } /* repeats on every page */
    .av-table tfoot {
      display: table-footer-group;
    }
    .av-table tr {
      break-inside: avoid;
    }
    .av-table thead th {
      position: static !important; /* sticky headers print on top of the body */
      background: transparent !important;
      color: #000 !important;
    }
    /* A URL the reader cannot click is worth showing, but only for links that
       leave the document. */
    a[href^=http]::after {
      content: " (" attr(href) ")";
      font-size: 0.85em;
      word-break: break-all;
    }
  }
}
