/* The iPhone app (ios/, Capacitor): the same pages, dressed as an iOS app. client/app.js adds .native-ios to <html>
   when the app's user agent says so (ios.appendUserAgent in capacitor.config.json); in a browser nothing here
   applies. Brand colors stay; what changes is iOS's own: bold SF for headings and numbers (the --display tokens in
   styles.css), translucent bars with hairlines, the tab bar's size, and press feedback. */
.native-ios {
  --display: -apple-system, "SF Pro Display", system-ui, sans-serif;
  --display-weight: 700;
  --tabbar: 50px;
  --bar: color-mix(in srgb, var(--bg) 78%, transparent);
  --hairline: .5px solid color-mix(in srgb, var(--ink) 20%, transparent);
  --blur: saturate(180%) blur(20px);
}

/* The status bar and the header: one translucent bar the full width of the screen, like a navigation bar. */
.native-ios body::before { background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.native-ios header.top:not(.gate-top) {
  position: sticky; top: env(safe-area-inset-top); z-index: 30; margin: 0 calc(50% - 50vw) 10px; min-height: 52px;
  padding: 6px calc(50vw - 50%);
  background: var(--bar); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: var(--hairline);
}
.native-ios header.top:not(.gate-top) .wordmark { font-size: 22px; }

/* The tab bar: iOS height, small medium-weight labels, translucent with a hairline. */
.native-ios nav.tabs { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: var(--hairline); }
.native-ios nav.tabs button { font-size: 10px; font-weight: 500; gap: 2px; letter-spacing: .01em; }
.native-ios nav.tabs button svg { width: 25px; height: 25px; }

/* Grouped lists and cards: iOS's corner radius and hairline separators. */
.native-ios :is(.card, .list) { border-radius: 14px; }
.native-ios .list > * + * { border-top: var(--hairline); }
.native-ios dialog.sheet { border-radius: 14px 14px 0 0; }

/* Touch: controls dim while pressed (instead of the web's shrink), and the app's chrome doesn't select as text.
   Content stays selectable, so an address or phone number can still be copied. */
.native-ios :is(nav.tabs, header.top, .btn, .seg, .list.links) { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.native-ios :is(button, a, .btn) { transition: opacity .2s; }
.native-ios :is(button, a, .btn):active { opacity: .5; transform: none; transition: none; }

/* A phone on its side is short (about 430px): the header scrolls away with the page there, so the content gets the
   room and only the tab bar stays. */
@media (max-height: 500px) {
  .native-ios header.top:not(.gate-top) { position: static; }
}
