/*
 * Follow Everything navigation shell
 *
 * This file is the only visual source of truth for navigation across the
 * public site, authentication, workspace, account and administration routes.
 * Page styles may define their own tokens, but must not redefine this shell.
 */

html {
  scroll-padding-top: 76px;
}

.app-shell-header.app-shell-header {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: 76px;
  display: block;
  overflow: visible;
  padding: 0 max(32px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line, #d9e0ea);
  background: var(--paper, #f9fbfe);
  backdrop-filter: blur(14px);
  color: var(--ink, #172033);
  isolation: isolate;
}

.app-shell-header.app-shell-header .shell-header-inner {
  position: relative;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin: 0;
  overflow: visible;
}

.app-shell-header.app-shell-header .brand {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink, #172033);
  text-decoration: none;
}

.app-shell-header.app-shell-header .brand img {
  width: 32px;
  height: 32px;
  display: block;
  flex: 0 0 auto;
}

.app-shell-header.app-shell-header .brand > span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.app-shell-header.app-shell-header .brand strong,
.app-shell-header.app-shell-header .brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell-header.app-shell-header .brand strong {
  color: var(--ink, #172033);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.app-shell-header.app-shell-header .brand small {
  color: var(--muted, #657083);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.app-shell-header.app-shell-header .app-site-nav {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted, #657083);
}

.app-shell-header.app-shell-header .app-site-nav a:not(.button) {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 9px;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.app-shell-header.app-shell-header .app-site-nav a:not(.button):hover,
.app-shell-header.app-shell-header .app-site-nav a:not(.button):focus-visible {
  color: var(--blue-deep, #1957b8);
  background: var(--blue-soft, #eaf2ff);
}

.app-shell-header.app-shell-header .app-site-nav a[aria-current="page"]:not(.button) {
  color: var(--blue-deep, #1957b8);
  background: var(--blue-soft, #eaf2ff);
  font-weight: 800;
}

.app-shell-header.app-shell-header .shell-mobile-cta,
.app-shell-header.app-shell-header .shell-public-cta {
  min-height: 40px;
  padding-inline: 16px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.app-shell-header.app-shell-header .shell-mobile-cta {
  display: none;
}

.app-shell-header.app-shell-header .shell-nav-context {
  display: none;
}

.app-shell-header.app-shell-header .app-menu-toggle {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-width: 44px;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  justify-self: end;
  padding: 9px 10px;
  border: 1px solid var(--line, #d9e0ea);
  border-radius: 11px;
  background: var(--paper, #f9fbfe);
  color: var(--ink, #172033);
  cursor: pointer;
}

.app-shell-header.app-shell-header .app-menu-toggle > span:not(.sr-only) {
  width: 20px;
  height: 2px;
  position: absolute;
  display: block;
  margin: 0;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

.app-shell-header.app-shell-header .app-menu-toggle > span:nth-of-type(2) {
  transform: translateY(-4px);
}

.app-shell-header.app-shell-header .app-menu-toggle > span:nth-of-type(3) {
  transform: translateY(4px);
}

.app-shell-header.app-shell-header .app-menu-toggle[aria-expanded="true"] {
  border-color: color-mix(in oklab, var(--blue, #0b73ed) 54%, var(--line, #d9e0ea));
  background: var(--blue-soft, #eaf2ff);
  color: var(--blue-deep, #1957b8);
}

.app-shell-header.app-shell-header .app-menu-toggle[aria-expanded="true"] > span:nth-of-type(2) {
  transform: rotate(45deg);
}

.app-shell-header.app-shell-header .app-menu-toggle[aria-expanded="true"] > span:nth-of-type(3) {
  transform: rotate(-45deg);
}

.app-shell-header.app-shell-header .header-state,
.app-shell-header.app-shell-header .header-auth-link,
.app-shell-header.app-shell-header .shell-public-actions,
.app-shell-header.app-shell-header .shell-account {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.app-shell-header.app-shell-header .shell-public-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.app-shell-header.app-shell-header .header-auth-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--blue-deep, #1957b8);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.app-shell-header.app-shell-header .header-auth-link:hover,
.app-shell-header.app-shell-header .header-auth-link:focus-visible {
  background: var(--blue-soft, #eaf2ff);
}

.app-shell-header.app-shell-header .shell-account {
  position: relative;
  min-width: 0;
}

.app-shell-header.app-shell-header .account-trigger {
  min-height: 44px;
  max-width: min(300px, 30vw);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 5px;
  border: 1px solid var(--line, #d9e0ea);
  border-radius: 12px;
  background: var(--paper, #f9fbfe);
  color: var(--ink, #172033);
  cursor: pointer;
  text-align: left;
}

.app-shell-header.app-shell-header .account-trigger:hover,
.app-shell-header.app-shell-header .account-trigger:focus-visible,
.app-shell-header.app-shell-header .account-trigger[aria-expanded="true"] {
  border-color: color-mix(in oklab, var(--blue, #0b73ed) 55%, var(--line, #d9e0ea));
  background: var(--blue-soft, #eaf2ff);
}

.app-shell-header.app-shell-header .account-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue, #0b73ed);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.app-shell-header.app-shell-header .account-trigger-copy {
  min-width: 0;
  display: grid;
}

.app-shell-header.app-shell-header .account-trigger-copy strong,
.app-shell-header.app-shell-header .account-trigger-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell-header.app-shell-header .account-trigger-copy strong {
  font-size: 11px;
  line-height: 1.25;
}

.app-shell-header.app-shell-header .account-trigger-copy small {
  max-width: 180px;
  color: var(--muted, #657083);
  font-size: 9px;
  line-height: 1.25;
}

.app-shell-header.app-shell-header .account-trigger-chevron {
  color: var(--muted, #657083);
  font-size: 16px;
  line-height: 1;
}

.app-shell-header.app-shell-header .account-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 9px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line, #d9e0ea);
  border-radius: 14px;
  background: var(--paper, #f9fbfe);
  box-shadow: 0 20px 45px rgb(28 43 68 / 15%);
}

.app-shell-header.app-shell-header .account-menu[hidden] {
  display: none !important;
}

.app-shell-header.app-shell-header .account-menu-heading {
  display: grid;
  gap: 2px;
  padding: 9px 10px 11px;
}

.app-shell-header.app-shell-header .account-menu-heading strong {
  font-size: 12px;
}

.app-shell-header.app-shell-header .account-menu-heading small {
  color: var(--muted, #657083);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.app-shell-header.app-shell-header .account-role {
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--blue-deep, #1957b8);
  background: var(--blue-soft, #eaf2ff);
  font-size: 9px;
  font-weight: 800;
}

.app-shell-header.app-shell-header .account-menu-links {
  display: grid;
  gap: 2px;
}

.app-shell-header.app-shell-header .account-menu-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft, #344056);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.app-shell-header.app-shell-header .account-menu-link:hover,
.app-shell-header.app-shell-header .account-menu-link:focus-visible {
  color: var(--blue-deep, #1957b8);
  background: var(--blue-soft, #eaf2ff);
}

.app-shell-header.app-shell-header .account-menu-divider {
  height: 1px;
  margin: 6px 2px;
  background: var(--line, #d9e0ea);
}

.app-shell-header.app-shell-header .account-menu-signout {
  color: var(--red, #d93025);
}

.app-shell-header.app-shell-header :is(a, button):focus-visible {
  outline: 3px solid color-mix(in oklab, var(--blue, #0b73ed) 45%, transparent);
  outline-offset: 2px;
}

/* The global header is now the workspace navigation. The old in-page copy is
   deliberately suppressed to avoid two competing navigation systems. */
body[data-app-mode="workspace"] .workspace-nav {
  display: none !important;
}

@media (max-width: 860px) {
  html { scroll-padding-top: 68px; }
  .app-shell-header.app-shell-header {
    min-height: 68px;
    padding-inline: 18px;
  }

  .app-shell-header.app-shell-header .shell-header-inner {
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 9px;
  }

  .app-shell-header.app-shell-header .app-menu-toggle {
    display: inline-flex;
  }

  .app-shell-header.app-shell-header .app-site-nav {
    grid-column: 1 / -1;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    width: auto;
    max-height: min(72vh, 470px);
    display: none !important;
    align-items: stretch;
    flex-direction: column;
    gap: 3px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line, #d9e0ea);
    border-radius: 15px;
    background: var(--paper, #f9fbfe);
    box-shadow: 0 22px 45px rgb(28 43 68 / 16%);
  }

  .app-shell-header.app-shell-header .app-site-nav.is-open,
  .app-shell-header.app-shell-header .app-site-nav.open {
    display: flex !important;
  }

  .app-shell-header.app-shell-header .app-site-nav a:not(.button) {
    min-height: 44px;
    width: 100%;
    padding: 0 12px;
    font-size: 13px;
  }

  .app-shell-header.app-shell-header .app-site-nav a[aria-current="page"]:not(.button) {
    box-shadow: inset 3px 0 0 var(--blue, #0b73ed);
  }

  .app-shell-header.app-shell-header .shell-mobile-cta {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    margin: 5px 0 0;
  }

  .app-shell-header.app-shell-header .shell-public-cta {
    display: none;
  }

  .app-shell-header.app-shell-header .shell-nav-context {
    display: block;
    padding: 8px 12px 5px;
    color: var(--blue-deep, #1957b8);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
  }

  .app-shell-header.app-shell-header .account-trigger {
    width: 44px;
    max-width: 44px;
    justify-content: center;
    padding: 5px;
  }

  .app-shell-header.app-shell-header .account-trigger-copy,
  .app-shell-header.app-shell-header .account-trigger-chevron {
    display: none;
  }
}

@media (max-width: 460px) {
  html { scroll-padding-top: 64px; }
  .app-shell-header.app-shell-header {
    min-height: 64px;
    padding-inline: 12px;
  }

  .app-shell-header.app-shell-header .shell-header-inner {
    min-height: 64px;
    gap: 7px;
  }

  .app-shell-header.app-shell-header .brand {
    gap: 8px;
  }

  .app-shell-header.app-shell-header .brand img {
    width: 28px;
    height: 28px;
  }

  .app-shell-header.app-shell-header .brand strong {
    font-size: 13px;
  }

  .app-shell-header.app-shell-header .brand small {
    display: block;
    font-size: 8px;
  }

  .app-shell-header.app-shell-header .header-auth-link {
    min-height: 40px;
    max-width: 96px;
    padding-inline: 6px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
  }

  .app-shell-header.app-shell-header .app-site-nav {
    right: 0;
    left: 0;
  }
}

@media (max-width: 350px) {
  html { scroll-padding-top: 64px; }
  .app-shell-header.app-shell-header .brand strong {
    font-size: 12px;
  }

  .app-shell-header.app-shell-header .brand small {
    font-size: 7px;
  }

  .app-shell-header.app-shell-header .header-auth-link {
    max-width: 74px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell-header.app-shell-header .app-menu-toggle > span:not(.sr-only) {
    transition: none;
  }
}
