header.top {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
header.top nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
header.top .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}
header.top .brand img {
  width: 34px;
  height: 34px;
  display: block;
}
header.top .brand span {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
/* Developers and Pricing on a product in private preview's pages: in place, greyed out and inert. */
header.top .nav-off {
  color: var(--muted);
  opacity: 0.55;
  pointer-events: none;
}
header.top .links {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-inline-start: 24px;
}
header.top .nav-main,
header.top .nav-account {
  display: flex;
  align-items: center;
  gap: 28px;
}
header.top .nav-account {
  margin-inline-start: auto;
}
header.top .nav-link,
header.top .nav-menu-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: normal;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
header.top .nav-link::after,
header.top .nav-menu-btn::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  bottom: 6px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-field);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
[dir='rtl'] header.top .nav-link::after,
[dir='rtl'] header.top .nav-menu-btn::after {
  transform-origin: right;
}
header.top .nav-link:hover,
header.top .nav-link:focus-visible,
header.top .nav-menu-btn:hover,
header.top .nav-menu-btn:focus-visible,
header.top .nav-menu.open .nav-menu-btn {
  color: var(--ink);
}
header.top .nav-link:hover::after,
header.top .nav-link:focus-visible::after,
header.top .nav-menu-btn:hover::after,
header.top .nav-menu-btn:focus-visible::after,
header.top .nav-menu.open .nav-menu-btn::after {
  transform: scaleX(1);
}
header.top .nav-link[aria-current]:not([aria-current='false']),
header.top .nav-menu-btn[aria-current]:not([aria-current='false']) {
  color: var(--ink);
}
header.top .nav-link[aria-current]:not([aria-current='false'])::after,
header.top .nav-menu-btn[aria-current]:not([aria-current='false'])::after {
  background: var(--accent);
  transform: scaleX(1);
}
header.top .nav-menu {
  position: relative;
}
header.top .nav-menu-btn svg {
  flex: none;
  transition: transform 0.15s;
}
header.top .nav-menu.open .nav-menu-btn svg {
  transform: rotate(180deg);
}
header.top .nav-menu-panel {
  display: none;
  position: absolute;
  inset-inline-start: -14px;
  top: 100%;
  z-index: 20;
  padding-top: 6px;
}
header.top .nav-menu.open .nav-menu-panel {
  display: block;
}
/* Without nav.js a menu opens while focus is inside it, so Sign out stays reachable; nav.js marks the menus it runs. */
header.top .nav-menu:not([data-started]):focus-within .nav-menu-panel {
  display: block;
}
header.top .nav-account .nav-menu-panel {
  inset-inline-start: auto;
  inset-inline-end: -14px;
}
header.top .nav-menu-list {
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-menu);
  padding: 6px;
}
header.top .nav-menu-heading {
  display: none;
}
header.top .nav-menu-list form {
  margin: 0;
}
header.top .nav-menu-list a,
header.top .nav-menu-list button {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  box-shadow: none;
  transform: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  text-align: start;
  white-space: normal;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
header.top .nav-menu-list a:hover,
header.top .nav-menu-list a:focus-visible,
header.top .nav-menu-list button:hover,
header.top .nav-menu-list button:focus-visible {
  background: var(--bg);
  color: var(--ink);
}
header.top .nav-menu-list a[aria-current]:not([aria-current='false']) {
  background: var(--bg);
  box-shadow: inset 3px 0 0 var(--accent);
}
header.top .nav-menu-list strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
header.top .nav-menu-list a span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--muted);
}
header.top .nav-group + .nav-group,
header.top .nav-group + form {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
header.top .nav-group > span {
  display: block;
  padding: 6px 12px 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
header.top .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 9.5em;
  min-height: 44px;
  padding: 10px 18px;
  margin-inline-start: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}
header.top .cta:hover {
  background: var(--accent-hover);
  color: var(--ink);
}
header.top .cta:active {
  transform: translateY(1px);
}
header.top .cta-reserve {
  visibility: hidden;
}
header.top .cta.cta-trial {
  flex-direction: column;
  padding-block: 5px;
  line-height: 1.2;
}
/* A product in private preview has nothing to try: the button stays in place, greyed and inert, at the Try button's size,
   since its second line is laid over a hidden copy of the trial's. */
header.top .cta.cta-soon,
header.top .cta.cta-soon:hover {
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--bg-sunken);
  color: var(--muted);
  font-family: inherit;
  cursor: default;
  transform: none;
}
header.top .cta-stack {
  display: grid;
}
header.top .cta-stack > * {
  grid-area: 1 / 1;
}
header.top .cta-stack > [aria-hidden] {
  visibility: hidden;
}
header.top .cta-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
}
header.top .nav-toggle {
  display: none;
}
@media (max-width: 1000px) {
  header.top .links,
  header.top .nav-main,
  header.top .nav-account {
    gap: 20px;
  }
  header.top .links {
    margin-inline-start: 8px;
  }
}
@media (max-width: 920px) {
  header.top nav {
    gap: 10px;
  }
  header.top .cta {
    margin-inline-start: auto;
    font-size: 15px;
    padding: 10px 16px;
  }
  header.top .nav-toggle {
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-inline-start: -4px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }
  header.top .nav-toggle:hover {
    background: var(--bg-sunken);
  }
  header.top .nav-toggle .icon-close,
  header.top .nav-toggle[aria-expanded='true'] .icon-open {
    display: none;
  }
  header.top .nav-toggle[aria-expanded='true'] .icon-close {
    display: block;
  }
  /* The phone menu: a sheet under the header that covers the page, with each section a row that opens in place. */
  header.top .links {
    display: none;
  }
  header.top nav.menu-open .links {
    position: fixed;
    top: var(--menu-top, 81px);
    inset-inline-end: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--line);
    background: var(--bg);
    animation: menu-in 0.18s ease-out;
  }
  header.top .nav-main,
  header.top .nav-account {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }
  header.top .nav-main > *,
  header.top .nav-account > .nav-menu {
    border-bottom: 1px solid var(--line-soft);
  }
  header.top .nav-menu-btn,
  header.top .nav-main > .nav-link {
    justify-content: space-between;
    width: 100%;
    min-height: 58px;
    padding: 0 4px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
  }
  header.top .nav-menu-btn::after,
  header.top .nav-link::after {
    display: none;
  }
  header.top .nav-menu-btn svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
  }
  /* A section shows nothing of its own when it holds the current page: it opens with the sheet, and the page itself is marked inside. */
  header.top .nav-menu-btn[aria-current]:not([aria-current='false']),
  header.top .nav-main > .nav-link[aria-current]:not([aria-current='false']) {
    box-shadow: none;
  }
  header.top .nav-main > .nav-link[aria-current]:not([aria-current='false'])::before {
    content: '';
    order: 2;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ink) inset;
  }
  header.top .nav-menu-panel,
  header.top .nav-account .nav-menu-panel {
    display: none;
    position: static;
    padding: 0 0 14px;
  }
  header.top .nav-menu.open .nav-menu-panel {
    display: block;
  }
  header.top .nav-menu-list {
    min-width: 0;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-xl);
    box-shadow: none;
    background: var(--surface);
  }
  header.top .nav-menu-list a,
  header.top .nav-menu-list button {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    padding-block: 8px;
    padding-inline: 14px 36px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
  }
  header.top .nav-menu-list a span {
    font-size: 14px;
  }
  header.top .nav-menu-list a[aria-current]:not([aria-current='false']) {
    background: var(--bg);
    box-shadow: none;
    font-weight: 600;
  }
  header.top .nav-menu-list a[aria-current]:not([aria-current='false'])::after {
    content: '';
    position: absolute;
    top: calc(50% - 4px);
    inset-inline-end: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ink) inset;
  }
  header.top .nav-group + .nav-group,
  header.top .nav-group + form {
    margin-top: 4px;
    padding-top: 4px;
  }
  header.top .nav-group > span {
    padding: 8px 14px 2px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  /* Sign in and the header's button sit together at the foot of the sheet, and the bar above keeps only the logo and Close. */
  header.top .nav-account {
    position: sticky;
    bottom: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding: 20px 0 calc(24px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, var(--bg) 16px);
  }
  header.top .nav-account > .nav-menu {
    flex: 1 1 100%;
  }
  header.top .nav-account > .nav-link {
    flex: 0 0 calc(50% - 6px);
    justify-content: center;
    min-height: 52px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
  }
  header.top .nav-account > .nav-link {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
  }
  /* The header's own button moves into that bar while the sheet is open: beside Sign in, or across it when signed in. */
  header.top nav.menu-open > .cta {
    position: fixed;
    inset-inline-end: var(--gutter);
    bottom: calc(24px + env(safe-area-inset-bottom));
    inset-inline-start: var(--gutter);
    z-index: 51;
    min-height: 52px;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
  }
  header.top nav.menu-open > .cta .cta-sub {
    display: none;
  }
  header.top nav.menu-open .nav-toggle {
    margin-inline-start: auto;
  }
  header.top nav.menu-open:has(.nav-account > .nav-link) > .cta {
    inset-inline-start: calc(50% + 6px);
  }
  header.top nav.menu-open:not(:has(.nav-account > .nav-link)) .nav-account {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  html.menu-locked {
    overflow: hidden;
  }
}
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@media (max-width: 420px), (min-width: 921px) and (max-width: 1119px) {
  header.top .brand span {
    display: none;
  }
}
/* Where the signed-out button would push the row onto a second line, allowing for a desktop scrollbar. */
@media (min-width: 921px) and (max-width: 960px) {
  header.top .links,
  header.top .nav-main,
  header.top .nav-account {
    gap: 14px;
  }
  header.top .cta {
    margin-left: 6px;
  }
}
@media (max-width: 495px) {
  html:not([data-signed-in]) header.top nav:has(> .cta-trial) .brand span,
  header.top nav:has(> .cta-trial:not([data-when])) .brand span {
    display: none;
  }
}
@media (max-width: 345px) {
  header.top .cta-sub {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  header.top *,
  header.top *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* The button nav.js puts over a side menu or a post's "On this page" on a narrow screen; the list folds under it. Shown here, not in
   site.css or content.css, because those rules sit in cascade layers this unlayered file always beats. */
.side-menu {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
}
.side-menu:is(:hover, :active, [aria-expanded='true']) {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.side-menu span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-menu small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.side-menu::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--ease);
}
.side-menu[aria-expanded='true']::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}
@media (max-width: 860px) {
  .side-menu[aria-controls='side-menu'] {
    display: flex;
  }
  .console-side .side-menu {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
  }
  body:has(.console-side) header.top .cta[data-nav='console'] {
    display: none;
  }
  body:has(.console-side) header.top .nav-toggle {
    margin-left: auto;
  }
}
@media (max-width: 960px) {
  .side-menu[aria-controls='toc-menu'] {
    display: flex;
  }
}

/* A cached page carries both states; session.js marks <html> before paint, and the state must win over each item's own display. */
html[data-signed-in] header.top [data-when='signed-out'],
html:not([data-signed-in]) header.top [data-when='signed-in'] {
  display: none !important;
}

/* Signed in, the account menu is a round initial with a green ring where Sign in sits when signed out, so the button keeps its place. */
header.top .avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--accent);
  transition: background-color 0.15s ease;
}
header.top .avatar:empty::before {
  content: var(--initial, '');
}
header.top .nav-avatar .nav-menu-list {
  width: max-content;
  max-width: 320px;
}
@media (min-width: 921px) {
  /* Just the ringed initial, close to the button beside it; signed out it is not shown, so Sign in keeps its own spacing. */
  header.top .nav-avatar {
    margin-right: -12px;
  }
  header.top .nav-avatar .nav-menu-btn::after,
  header.top .nav-avatar .avatar-label,
  header.top .nav-avatar .nav-menu-btn > svg {
    display: none;
  }
  header.top .nav-avatar .nav-menu-btn:hover .avatar,
  header.top .nav-avatar.open .avatar {
    background: var(--line);
  }
}
@media (max-width: 920px) {
  header.top .nav-avatar .nav-menu-btn {
    justify-content: flex-start;
    gap: 12px;
  }
  header.top .nav-avatar .nav-menu-btn > svg {
    margin-left: auto;
  }
  header.top .nav-avatar .avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

/* Staff see the back office one click away on every app page, in the staff colours so it never reads as part of the customer's console. */
header.top .nav-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--staff-line);
  border-radius: 999px;
  background: var(--staff-soft);
  color: var(--staff);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
header.top .nav-admin:hover {
  background: #fde9a8;
}
header.top .nav-admin[aria-current='true'] {
  border-color: var(--staff);
  background: var(--staff);
  color: #fff;
}
header.top .nav-menu-id {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  padding: 8px 12px 14px;
  border-bottom: 1px solid var(--line);
}
header.top .nav-avatar .nav-menu-id .avatar {
  width: 36px;
  height: 36px;
  box-shadow: none;
  background: var(--accent);
  color: var(--accent-ink);
}
header.top .nav-menu-id > span:last-child {
  display: grid;
  min-width: 0;
}
header.top .nav-menu-id strong {
  overflow: hidden;
  font-size: 14px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
header.top .nav-menu-id small {
  justify-self: start;
  margin-top: 3px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--staff-soft);
  color: var(--staff);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}
header.top .nav-avatar .nav-menu-list :is(a, button) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
header.top .nav-avatar .nav-menu-list .icon {
  flex: none;
  color: var(--muted);
}
header.top .nav-avatar .nav-menu-list .nav-menu-admin,
header.top .nav-avatar .nav-menu-list .nav-menu-admin .icon {
  color: var(--staff);
  font-weight: 600;
}
header.top .nav-avatar .nav-menu-list .nav-menu-admin:hover,
header.top .nav-avatar .nav-menu-list .nav-menu-admin[aria-current='true'] {
  background: var(--staff-soft);
}
header.top .nav-avatar .nav-menu-list .nav-menu-admin[aria-current='true'] {
  box-shadow: inset 3px 0 0 var(--staff);
}
@media (min-width: 921px) {
  header.top .nav-account:has(> .nav-admin) {
    gap: 20px;
  }
}
@media (max-width: 920px) {
  header.top .nav-admin {
    justify-content: flex-start;
    gap: 12px;
    height: auto;
    min-height: 58px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    background: none;
    font-size: 17px;
  }
  header.top .nav-admin[aria-current='true'] {
    background: none;
    color: var(--staff);
  }
  header.top .nav-menu-id {
    display: none;
  }
}

/* Staff off the admin network who click Admin: the back office opens only on the VPN. A popover, so it sits in the top layer over the page. */
.vpn-pop {
  width: min(420px, calc(100vw - 32px));
  margin: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(26, 29, 23, 0.24);
}
.vpn-pop::backdrop {
  background: rgba(22, 25, 15, 0.4);
}
.vpn-pop-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--staff-soft);
  color: var(--staff);
}
.vpn-pop h2 {
  margin: 16px 0 6px;
  font-size: 20px;
  line-height: 1.3;
}
.vpn-pop p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
.vpn-pop .vpn-pop-still {
  margin-top: 12px;
  color: var(--danger);
  font-weight: 500;
}
.vpn-pop-still:empty {
  display: none;
}
.vpn-pop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Turbo's bar over the top of the window while a slow page loads. The vendored Turbo inserts no style element of its own, which the
   Content-Security-Policy (style-src 'self') would refuse; Turbo sets only its width and opacity, inline. */
.turbo-progress-bar {
  position: fixed;
  display: block;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 2147483647;
  transition:
    width 300ms ease-out,
    opacity 150ms 150ms ease-in;
  transform: translate3d(0, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
  .turbo-progress-bar {
    transition: none;
  }
}
/* Without scripts the phone sheet cannot open, so its sections stay under the bar, each open while focus is in it. */
@media (max-width: 920px) and (scripting: none) {
  header.top .nav-toggle {
    display: none;
  }
  header.top .links {
    display: flex;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
  }
}
