
  *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  /* Neutralise the UA stylesheet for [popover]. PositionController promotes
     floating panels to the top layer, and the UA rules for a popover include
     a solid border, padding, a canvas background and inset:0/margin:auto —
     enough to inflate a measured panel by 14px and to paint a border no
     component asked for. :where() keeps this at zero specificity so it beats
     the UA origin but loses to every rule a component writes for itself. */
  :where([popover]) {
    border: 0;
    padding: 0;
    margin: 0;
    inset: auto;
    width: auto;
    height: auto;
    background: none;
    color: inherit;
    overflow: visible;
  }

  :host {
    transition: opacity var(--transition-fast);

    
    /* Generated from shared/tokens.js by scripts/generate/host-tokens.js. */
    /* Do not edit by hand — edit the token tree instead. */

    --font-body: var(--font-body-family, 'Host Grotesk'), var(--font-body-fallback, system-ui, sans-serif);
    --font-label: var(--font-label-family, 'Tomorrow'), var(--font-label-fallback, system-ui, -apple-system, Segoe UI, sans-serif);
    --font-mono: var(--font-mono-family, 'JetBrains Mono'), var(--font-mono-fallback, ui-monospace, monospace);
    --font-quote: var(--font-quote-family, Georgia), var(--font-quote-fallback, serif);
    --font-display: var(--font-display-family, var(--font-body-family, 'Host Grotesk')), var(--font-display-fallback, var(--font-body-fallback, system-ui, sans-serif));
    --font-accent: var(--font-label);

    /* Private mirrors: components read these, consumers override --text-*. */
    --_text-xs: var(--text-xs, 12px);
    --_text-sm: var(--text-sm, 16px);
    --_text-md: var(--text-md, 17px);
    --_text-lg: var(--text-lg, clamp(18px, 1.5vw, 20px));
    --_text-xl: var(--text-xl, clamp(22px, 2.5vw, 26px));
    --_text-2xl: var(--text-2xl, clamp(28px, 3vw, 36px));
    --_text-3xl: var(--text-3xl, clamp(36px, 5vw, 52px));

    --display-xl-size: var(--_text-3xl);
    --display-xl-weight: var(--font-display-weight, 500);
    --display-xl-spacing: -1px;
    --heading-size: var(--_text-xl);
    --heading-weight: var(--font-display-weight, 500);
    --heading-lh: 1.2;
    --body-size: var(--_text-md);
    --body-weight: var(--font-body-weight, 500);
    --body-lh: 1.7;
    --wordmark-size: clamp(20px, 2.5vw, 28px);
    --wordmark-weight: var(--font-display-weight, 500);
    --wordmark-spacing: clamp(8px, 1.2vw, 14px);
    --section-title-size: var(--_text-xs);
    --section-title-weight: var(--font-label-weight, 600);
    --section-title-spacing: 2px;
    --ui-accent-size: 16px;
    --ui-accent-weight: var(--font-label-weight, 600);
    --ui-accent-spacing: 0.5px;
    --code-size: 14px;
    --code-lh: 1.8;
    --label-inline-size: 10px;
    --label-inline-spacing: 0.75px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 128px;

    /* Radii */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions and motion */
    --transition-fast: var(--duration-fast) var(--ease-standard);
    --transition-base: var(--duration-base) var(--ease-standard);
    --transition-slow: var(--duration-slow) var(--ease-standard);
    --transition-enter: var(--duration-enter) var(--ease-out);
    --transition-exit: var(--duration-exit) var(--ease-in);
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 400ms;
    --duration-enter: 500ms;
    --duration-exit: 300ms;
    --ease-out-expo: var(--ease-out);
    --ease-in-out: var(--ease-standard);

    /* Z-index */
    --z-base: 0;
    --z-dropdown: 1000;
    --z-tooltip: 1100;
    --z-overlay: 1200;
    --z-modal: 1300;
    --z-toast: 1400;
    --z-max: 9999;

    /* Glow and focus */
    --glow-xs: 0 0 6px rgba(var(--accent-primary-rgb), 0.3);
    --glow-sm: 0 0 8px rgba(var(--accent-primary-rgb), 0.3);
    --glow-md: 0 0 12px rgba(var(--accent-primary-rgb), 0.25);
    --glow-status: 0 0 12px rgba(var(--_status-rgb), var(--glow-status-alpha, 0.15));
    --glow-status-alpha: 0.15;
    --glow-hover: 0 0 12px rgba(var(--accent-primary-rgb), 0.15);
    --focus-ring: 0 0 0 1px rgba(var(--accent-primary-rgb),0.25);
    --focus-glow: 0 0 0 1px rgba(var(--accent-primary-rgb),0.2), 0 0 6px rgba(var(--accent-primary-rgb),0.35), 0 0 16px rgba(var(--accent-primary-rgb),0.2), 0 0 40px rgba(var(--accent-secondary-rgb),0.12);
    --focus-error: 0 0 0 2px var(--surface-base), 0 0 0 4px var(--color-error), 0 0 16px rgba(var(--color-error-rgb), 0.2);
    --focus-inset: inset 0 0 0 2px var(--interactive);
    --focus-thumb: 0 0 8px rgba(var(--interactive-rgb), 0.5), 0 0 20px rgba(var(--interactive-rgb), 0.25);

    /* Semantic aliases */
    --interactive: var(--accent-primary);
    --interactive-rgb: var(--accent-primary-rgb);
    --interactive-hover: var(--glow-hover);
    --interactive-active: var(--glow-primary);
    --interactive-focus: var(--focus-glow);
    --interactive-focus-ring: var(--focus-ring);
    --interactive-focus-error: var(--focus-error);
    --interactive-focus-inset: var(--focus-inset);
    --interactive-focus-thumb: var(--focus-thumb);
    --interactive-muted: var(--text-ghost);
    --surface-base: var(--bg-deep);
    --surface-primary: var(--bg-surface);
    --surface-raised: var(--bg-card);
    --surface-overlay: var(--bg-elevated);
    --surface-hover: var(--bg-hover);
    --divider: var(--border-subtle);
    --on-accent: var(--surface-base);

    /* Interactive and layout */
    --touch-min: 24px;
    --touch-pad: 4px;
    --max-width: 1120px;
    --max-width-sm: 720px;
    --nav-height: 64px;
    --nav-row-inset: var(--space-sm);

  }

  
  @media (pointer: coarse) {
    :host {
      --touch-min: 36px;
      --touch-pad: 8px;
    }
  }


  /* Reduced motion, once, for every component that adopts these styles.

     This was copy-pasted verbatim into sixty-nine component files while fifteen
     animating components had no guard at all — which is the usual outcome when
     a cross-cutting rule is a convention rather than a place. Components keep
     their own blocks only for what this cannot express: scroll-behavior,
     animation-play-state, a transform that must be neutralised rather than
     shortened.

     0.01ms rather than "animation: none" on purpose. A component that removes
     itself on animationend — the exiting toast and snackbar both do — would
     wait forever for an event that a canceled animation never fires. A
     duration this short is imperceptible and still completes. */
  @media (prefers-reduced-motion: reduce) {
    :host *,
    :host *::before,
    :host *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

      :host {
        display: inline-block;
      }

      /* No horizontal padding: the first trigger (and its flush-left panel)
         must line up with the bar's left edge. */
      .menubar {
        display: flex;
        align-items: stretch;
        gap: var(--space-xs);
        padding: var(--space-xs) 0;
        background: var(--surface-raised);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-md);
        font-family: var(--font-body);
        font-size: var(--_text-sm);
      }

      .top {
        position: relative;
        display: flex;
      }

      .trigger {
        display: inline-flex;
        align-items: center;
        padding: var(--space-sm) var(--space-md);
        min-height: var(--touch-min);
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font: inherit;
        border-radius: var(--radius-sm);
        cursor: pointer;
        white-space: nowrap;
        transition: background var(--transition-fast), color var(--transition-fast);
      }

      .trigger:hover,
      .trigger.is-open {
        background: rgba(var(--interactive-rgb), 0.08);
        color: var(--text-primary);
      }

      .trigger:focus-visible {
        outline: none;
        box-shadow: var(--interactive-focus-ring);
      }

      .trigger[aria-disabled='true'] {
        color: var(--text-muted);
        opacity: 0.5;
        cursor: default;
      }

      .trigger[aria-disabled='true']:hover {
        background: transparent;
        color: var(--text-muted);
      }

      .menu {
        position: absolute;
        z-index: var(--z-dropdown);
        /* 320px was too narrow for an ordinary label+shortcut row: labels are
           flex: 1 with text-overflow: ellipsis, so anything longer than the
           panel is truncated, and "Ask for a change  ⌘K" is not a long label.
           The cap is now both larger and overridable — it was a hard-coded
           number with no token behind it, so a consumer could only reach it
           through ::part(menu).

           width: max-content makes the panel size to its widest item rather
           than to whatever shrink-to-fit resolves against its containing block.
           An absolutely positioned box is sized
             min(max(min-content, available), max-content)
           where "available" comes from the nearest positioned ancestor — here
           the trigger — so the panel's width was a function of what it happened
           to be nested in rather than of what it contains. The viewport-relative
           max-width keeps it from overflowing a genuinely narrow screen. */
        width: max-content;
        min-width: 200px;
        max-width: var(--menu-max-width, min(420px, calc(100vw - 2 * var(--space-md))));
        background: var(--surface-raised);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-md);
        padding: var(--space-sm);
        box-shadow: var(--shadow-overlay);
        animation: menu-in 120ms var(--ease-out-expo);
      }

      /* Resting positions, for menus PositionController hasn't adopted — the
         static HTML export and anything pre-upgrade. Once managed, the panels
         are in the top layer at fixed coordinates and PositionController owns
         the flip that .menu--flipped used to encode. */
      .menu--top:not([data-managed]) {
        top: calc(100% + var(--space-xs));
        inset-inline-start: 0;
      }

      /* Anchored to the full-width item row: left 100% is the item's right
         edge, i.e. the panel's inner right edge. Add the panel's right
         padding + border so the submenu clears the parent panel, minus a
         4px overlap for visual continuity (never enough to reach item text:
         the panel padding alone is 8px). Top offset cancels the panel's own
         padding so the first submenu item aligns with the parent item.
         PositionController reproduces both numbers as offset/crossOffset. */
      .menu--sub:not([data-managed]) {
        top: calc(-1 * var(--space-sm) - 1px);
        inset-inline-start: calc(100% + var(--space-sm) + 1px - var(--space-xs));
      }

      @keyframes menu-in {
        from { opacity: 0; transform: translateY(-4px); }
        to { opacity: 1; transform: translateY(0); }
      }

      /* Containing block for .menu--sub. Must span the panel's full inner
         width so the submenu's left: 100% resolves to the panel's inner
         right edge rather than a shrink-wrapped item box. */
      .item-wrap {
        position: relative;
        width: 100%;
      }

      .item {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        width: 100%;
        padding: var(--touch-pad) var(--space-md);
        min-height: var(--touch-min);
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font: inherit;
        text-align: start;
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: background var(--transition-fast), color var(--transition-fast);
      }

      .item:hover,
      .item.is-active {
        background: rgba(var(--interactive-rgb), 0.08);
        color: var(--text-primary);
      }

      .item:focus-visible {
        outline: none;
        box-shadow: inset var(--interactive-focus);
      }

      .item.is-disabled,
      .item.is-disabled:hover {
        background: transparent;
        color: var(--text-muted);
        opacity: 0.5;
        cursor: default;
      }

      .item__label {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      /* gap + margin keeps at least var(--space-lg) between label and shortcut */
      .item__shortcut {
        flex-shrink: 0;
        margin-inline-start: var(--space-md);
        font-family: var(--font-mono);
        font-size: var(--_text-xs);
        color: var(--text-ghost);
      }

      .item__caret {
        flex-shrink: 0;
        color: var(--text-muted);
        line-height: 1;
      }

      .divider {
        height: 1px;
        margin: var(--space-xs) 0;
        background: var(--border-subtle);
      }
    
    .menu[data-managed] {
      /* Belt-and-braces with the inline styles: a panel promoted to the top
         layer inherits the UA's [popover] rules, whose inset:0 and margin:auto
         would centre it in the viewport if a coordinate write were ever
         missed. */
      inset: auto;
      margin: 0;
    }
    

    /* Grow out of the anchored edge, and follow a flip. data-placement is the
       side the panel actually landed on, not the one that was asked for. */
    .menu[data-managed][data-placement='bottom'] { transform-origin: top center; }
    .menu[data-managed][data-placement='top'] { transform-origin: bottom center; }
    .menu[data-managed][data-placement='right'] { transform-origin: center left; }
    .menu[data-managed][data-placement='left'] { transform-origin: center right; }
  