Unfortunately, having the same content on a mobile page would be considered a duplicate. This is among the few legitimate sources of inevitable content duplication, along with syndicated content and news/blog homepages.
But if you just have a single URL for each page and simply switching the CSS based on cookies, then there's really only one page. This is also one of the advantages of responsive design and media queries. If your mobile and main site have the exact same content, then there's really no need to have 2 separate sites/pages.
However, in many cases, mobile and non-mobile users aren't looking for the exact same content/services. This would be the reason for building a separate mobile portal. You may still have some overlap in content, but such content can be presented slightly differently from the main site, e.g. abridged/summarized, in different groupings/contexts, with additional info, etc.
Otherwise, you could simply link the two versions using a rel="alternate" tag:
<link rel="alternate" media="handheld" href="...">
I don't think Google has come out and stated that they judge alternate links differently for content duplication, but it's a logical behavior. If they don't yet take alternates into account when considering duplications, then they eventually will. I've always been a strong believer in pro-active SEO that aims for where search engines will be in the future rather than limiting my SEO efforts to just the current ranking factors. By doing what's logical and best for UX rather than always waiting for the search engines to implement a factor before you start taking it into account, you can stay ahead of the game instead of constantly playing catch-up to the search engines.
Alternatively, if you want to make some main site content available through the mobile site as well, but it's not really part of the core mobile UX and is simply included for completeness, you could give it a canonical link to the non-mobile version. This will prevent it from showing up in search results, but that's OK since it's content that users would be unlikely to search for on mobile devices.
The last approach that many seem to advocate is to do some benign cloaking by always redirecting search engine crawlers to the non-mobile URL. I'm not a big fan of this, as it's a rather kludgy solution IMO.