/*
 * The site's floating pill header, inside the client workspace (Ben, 17 Oct:
 * "put it in the dashboard too"). Ported from the direction B "Site Plan"
 * prototype (docs/design/directions/helios/prototype/assets/css/base.css, the
 * .nav rules) and scoped to .pw-pill so nothing leaks into the workspace.
 * SF Pro through the system stack, 600 at most, PlanWatch amber.
 * The switch itself is audience-switch.css (copied from the prototype as is).
 *
 * Layout with the workspace (workspace.css, .ws-body.has-pill): the pill is
 * fixed at the top; the sidebar and the page's own bar (title, Help, sidebar
 * menu) are pinned just under it, so both stay in view.
 */

:root {
  --pill-h: 60px;
  --pill-top: 14px;
  --pill-clear: calc(var(--pill-h) + var(--pill-top) * 2 + env(safe-area-inset-top, 0px));
}
@media (max-width: 900px) {
  :root { --pill-h: 54px; --pill-top: 10px; --pill-clear: calc(var(--pill-h) + var(--pill-top) + 8px + env(safe-area-inset-top, 0px)); }
}

.pw-pill {
  /* "Site Plan" tokens the pill and the switch read (docs/brand/assets/tokens.css) */
  --font-display: "SF Pro Display", "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "SF Pro Text", "SF Pro Display", "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #111214; --ink-2: #3F434A; --ink-3: #6B6F77;
  --paper: #FFFFFF; --rule: #E7E4DD;
  --amber: #F59E0B; --amber-field: #FFBE3B;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-instant: 120ms; --dur-quick: 200ms;

  position: fixed; top: calc(var(--pill-top) + env(safe-area-inset-top, 0px)); left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); z-index: 60; pointer-events: none;
  font-family: var(--font-sans); letter-spacing: -0.01em; color: var(--ink);
}
.pw-pill a { color: inherit; text-decoration: none; }
.pw-pill-bar {
  pointer-events: auto; position: relative; width: calc(100% - 28px); max-width: 1180px; height: var(--pill-h); margin: 0 auto; padding: 0 8px 0 20px;
  display: flex; align-items: center; gap: 28px; border-radius: 999px;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.7) blur(18px); backdrop-filter: saturate(1.7) blur(18px);
  /* Softer than the site's: in the dashboard the pill sits on a band right above the page bar. */
  box-shadow: 0 0 0 1px rgba(17, 18, 20, .08), 0 8px 22px -14px rgba(17, 18, 20, .3);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pw-pill-bar, }
.pw-pill-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; white-space: nowrap; }
.pw-pill-brand svg { width: 26px; height: 26px; }
.pw-pill-brand b { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; line-height: 1; }
.pw-pill .pw-aud { margin-left: -8px; --aud-h: 40px; --aud-in: 3px; --aud-ico: 25px; --aud-gap: 5px; --aud-pl: 7px; --aud-pr: 14px; --aud-fs: 14px; }
.pw-pill-links { display: flex; gap: 24px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pw-pill-links a { white-space: nowrap; transition: color var(--dur-instant); }
.pw-pill-links a:hover { color: var(--ink); }
.pw-pill-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pw-pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--ink); color: var(--paper) !important; font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
  transition: background-color var(--dur-instant) var(--ease-out);
}
.pw-pill-btn:hover { background: #2a2c30; }
.pw-pill-btn .ws-i { color: currentColor; }
.pw-pill-btn--ghost { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1px #D5D1C7; }
.pw-pill-btn--ghost:hover { background: #F7F5F0; }
.pw-pill-burger { display: none; width: 44px; height: 44px; border: 0; border-radius: 999px; align-items: center; justify-content: center; background: rgba(17, 18, 20, .06); color: var(--ink); cursor: pointer; }
.pw-pill-burger path { transition: transform var(--dur-quick) var(--ease-out); transform-origin: 8px 8px; }
.pw-pill-burger[aria-expanded="true"] .b1 { transform: translateY(2.5px) rotate(45deg); }
.pw-pill-burger[aria-expanded="true"] .b2 { transform: translateY(-2.5px) rotate(-45deg); }
.pw-pill a:focus-visible, .pw-pill button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(245, 158, 11, .35); }

@media (max-width: 1100px) { .pw-pill-bar { gap: 16px; } .pw-pill-links { gap: 14px; } }
/* Phones and small tablets (the workspace drawer's breakpoint): links move into the drawer. */
@media (max-width: 900px) {
  .pw-pill-bar { width: calc(100% - 20px); padding: 0 6px 0 14px; gap: 10px; }
  .pw-pill-links, .pw-pill-btn--ghost { display: none; }
  .pw-pill-burger { display: inline-flex; }
  .pw-pill .pw-aud { margin-left: 0; }
}
/* Phones: the switch shows its house and hammer (words stay for screen
   readers), the account button its icon, so the pill fits at 320 px. */
@media (max-width: 699px) {
  .pw-pill .pw-aud { --aud-h: 44px; --aud-in: 4px; --aud-ico: 25px; --aud-pl: 7px; --aud-pr: 7px; }
  .pw-pill .pw-aud .pw-aud-opt { min-width: 44px; }
  .pw-pill .pw-aud .pw-aud-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .pw-pill-btn { width: 44px; height: 44px; padding: 0; }
  .pw-pill-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 380px) { .pw-pill-brand b { display: none; } }
