/* Talentport Team Portal: the Talentport Mac app (mac.js); only matches html.tp-mac. Split out on 7 Oct 2026 (clean-up wave 3):
   one screen, one script and one stylesheet. */

/* ============================================================================
   Mac app (M1): html.tp-mac is only ever set inside the Talentport Mac app
   (Mac Catalyst; index.html, from the app's user agent). None of this can
   match a browser, the iPhone app or the iPad app. SHELL_SPEC "macOS app".
   ============================================================================ */

/* Today's desktop in the Mac app: the window keeps its title bar, which sits
   over the top of the page, so the page starts below it (the old sidebar
   already pads itself by the same safe-area inset). */
html.tp-mac:not(.tp-desk2) #app-shell:not(.hidden) { padding-top: env(safe-area-inset-top); }

/* A Mac app without native capture (older than M2) can't capture the screen:
   the shift's capture runs in the browser tab they clocked in from. When the
   portal thinks capture has stopped, the banner says so, without its Share
   screen button (the Mac WebView has no getDisplayMedia). With M2's capture
   (html.tp-mac-capture) the banner keeps its button, which resumes the app's
   own capture. */
html.tp-mac:not(.tp-mac-capture) #compliance-banner > * { display: none !important; }
html.tp-mac:not(.tp-mac-capture) #compliance-banner::before {
  content: "Screen capture runs in the browser tab you clocked in from. Keep that tab open, or re-share your screen there.";
}

@media (min-width: 769px) {
  /* The new shell: no title bar. The page's 52px toolbar is the window's
     toolbar; the traffic lights sit centred in the sidebar's top row. */
  html.tp-mac.tp-desk2 { --d2-top: 52px; }
  html.tp-mac.tp-desk2 #d2-sidebar { background: #F6F6F2; border-right-color: rgba(0, 0, 0, .09); }
  html.tp-mac.tp-desk2 .d2-logo { position: relative; height: auto; flex: 0 0 auto; padding: 52px 22px 10px; }
  html.tp-mac.tp-desk2 .d2-side-toggle { position: absolute; top: 11px; right: 12px; }
  html.tp-mac.tp-desk2 .d2-item:hover { background: rgba(0, 0, 0, .05); }
  html.tp-mac.tp-desk2 .d2-item.is-active { background: rgba(245, 197, 0, .28); }
  html.tp-mac.tp-desk2 .d2-you { border-top-color: rgba(0, 0, 0, .08); }

  html.tp-mac.tp-desk2 #d2-topbar { height: 52px; flex-basis: 52px; padding: 0 16px 0 20px; gap: 10px; }
  /* Sidebar hidden: leave the traffic lights their corner of the toolbar. */
  html.tp-mac.tp-desk2.d2-side-collapsed #d2-topbar { padding-left: 86px; }
  html.tp-mac.tp-desk2 .d2-title-text { line-height: 19px; }
  html.tp-mac.tp-desk2 .d2-sub { font-size: var(--d2-t-11); line-height: 14px; }
  html.tp-mac.tp-desk2 .d2-search { width: 220px; flex-basis: 220px; height: 28px; border-radius: 7px; font-size: var(--d2-t-13); }
  html.tp-mac.tp-desk2 .d2-clock { height: 28px; border-radius: 14px; padding-left: 12px; gap: 7px; font-size: var(--d2-t-12); }
  html.tp-mac.tp-desk2 .d2-cbtn { height: 22px; border-radius: 11px; padding: 0 9px; font-size: var(--d2-t-12); }
  html.tp-mac.tp-desk2 .d2-cbtn:disabled { opacity: .42; }
  html.tp-mac.tp-desk2 .d2-teamnow { height: 28px; }
  html.tp-mac.tp-desk2 .d2-viewas { height: 28px; border-radius: 7px; }
  html.tp-mac.tp-desk2 .d2-iconbtn,
  html.tp-mac.tp-desk2 .d2-bell { width: 30px; height: 30px; border-radius: 7px; }
  html.tp-mac.tp-desk2 .d2-avatar { width: 30px; height: 30px; }
}
