@layer components {
  /* The project's status, chosen from one menu in the project bar. Salesforce sits apart, beside it. */
  .status-menu {
    position: relative;
  }

  .status-menu__chevron {
    margin-left: var(--space-xs);
    color: var(--ink-muted);
  }

  .status-menu__menu {
    min-width: 16rem;

    & .menu__item {
      width: 100%;
      font: inherit;
      font-weight: var(--weight-emphasis);
      text-align: left;
      background: none;
      border: 0;
      cursor: pointer;

      &:hover {
        background: var(--sheet-head);
      }
    }

    & span.menu__item {
      cursor: default;
    }

    & .menu__item .icon:not(.icon--salesforce, .menu__check) {
      color: var(--ink-muted);
    }

    & .menu__item[aria-current] .icon {
      color: var(--navy);
    }
  }

  /* The icon centres on the label line, as in a button; the note sits under the label. */
  .status-menu__item {
    display: grid;
  }

  .status-menu__label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);

    /* Barlow's capitals sit low in the line box: nudge the icon onto their centre. */
    & .icon {
      flex: none;
      width: 1.1rem;
      height: 1.1rem;
      translate: 0 0.09rem;
    }
  }

  .status-menu__note {
    padding-left: calc(1.1rem + var(--space-sm));
    font-size: var(--text-sm);
    font-weight: var(--weight-body, 500);
    color: var(--ink-muted);
  }

  .page-bar__end:has(> .status-menu) {
    gap: var(--space-lg);
  }

  .page-actions .icon--salesforce {
    color: var(--salesforce);
  }

  /* On phones the menu sits at the left of the bar, so it opens rightwards. */
  @media (max-width: 720px) {
    .status-menu__menu {
      right: auto;
      left: 0;
    }
  }
}
