.ap-project-bar {
  --ap-bar-bg: #11151b;
  --ap-bar-fg: #cbd2dc;
  --ap-bar-active: #ffffff;
  background: var(--ap-bar-bg);
  box-sizing: border-box;
  color: var(--ap-bar-fg);
  font: 500 13px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 54px;
}

.ap-project-bar__inner {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  gap: 0.55rem;
  margin: 0 auto;
  min-height: 54px;
  padding: 0.45rem 0;
  width: min(calc(100% - 2.5rem), 1100px);
}

.ap-project-bar__context {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 0.2rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  white-space: nowrap;
}

.ap-project-bar__context a {
  border-radius: 8px;
  color: inherit;
  padding: 0.5rem 0.68rem;
  text-decoration: none;
}

.ap-project-bar__context a:hover,
.ap-project-bar__context a:focus-visible {
  background: #252c36;
  color: var(--ap-bar-active);
  outline: none;
}

.ap-project-switcher {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  z-index: 80;
}

.ap-project-identity-group {
  align-items: flex-start;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.ap-project-identity {
  align-items: baseline;
  color: inherit;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 820;
  letter-spacing: -0.025em;
  min-width: 0;
  padding: 0.48rem 0;
  text-decoration: none;
  white-space: nowrap;
}

.ap-project-update {
  color: var(--text-faint, #9aa5b1);
  display: block;
  font-size: 0.64rem;
  font-weight: 620;
  letter-spacing: 0.015em;
  line-height: 1.15;
  margin-top: -0.3rem;
  white-space: nowrap;
}

.ap-project-identity:hover,
.ap-project-identity:focus-visible {
  color: var(--ap-bar-active, currentColor);
  outline: none;
}

.ap-project-switcher > summary {
  align-items: center;
  background: var(--bg-elevated, #151b23);
  border: 1px solid var(--border, #3a4552);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 760;
  gap: 0.48rem;
  list-style: none;
  min-height: 2.45rem;
  padding: 0.48rem 0.72rem;
  user-select: none;
}

.ap-project-switcher > summary::-webkit-details-marker {
  display: none;
}

.ap-project-switcher > summary::after {
  border-bottom: 0;
  border-left: 0.3rem solid transparent;
  border-right: 0.3rem solid transparent;
  border-top: 0.38rem solid currentColor;
  content: "";
  opacity: 0.62;
  transform-origin: 50% 42%;
  transition: transform 140ms ease;
}

.ap-project-switcher[open] > summary::after {
  transform: rotate(180deg);
}

.ap-project-switcher > summary:hover,
.ap-project-switcher > summary:focus-visible,
.ap-project-switcher[open] > summary {
  background: #252c36;
  border-color: #3a4552;
  color: var(--ap-bar-active, currentColor);
  outline: none;
}

.ap-project-switcher__menu {
  background: var(--bg-elevated, #151b23);
  border: 1px solid var(--border-strong, #3a4552);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.38);
  color: var(--text-muted, #cbd2dc);
  display: grid;
  gap: 0.45rem;
  left: 0;
  min-width: 13rem;
  padding: 0.55rem;
  position: absolute;
  top: calc(100% + 0.45rem);
}

.ap-project-switcher__section + .ap-project-switcher__section {
  border-top: 1px solid var(--border, #303946);
  padding-top: 0.45rem;
}

.ap-project-switcher__link {
  border-radius: 8px;
  border-left: 0.18rem solid transparent;
  color: inherit;
  display: block;
  padding: 0.52rem 0.62rem;
  text-decoration: none;
}

.ap-project-switcher__link[data-project-theme] {
  border-left-color: var(--palette-accent, transparent);
}

.ap-project-switcher__link:hover,
.ap-project-switcher__link:focus-visible,
.ap-project-switcher__link[aria-current="page"] {
  background: var(--palette-accent-soft, var(--accent-soft, #2a333f));
  color: var(--palette-accent-strong, var(--text, #ffffff));
  outline: none;
}

.ap-project-switcher__link[aria-current="page"]::after {
  content: "Current";
  float: right;
  font-size: 0.68rem;
  margin-left: 1.25rem;
  opacity: 0.65;
}

/* ADK's staged package retains its project-owned links; the shared compositor
   places only the selector in the former brand slot. Navigation is a toolbar,
   so it may use the wider page shell instead of inheriting the prose width. */
.site-nav > .nav-inner {
  width: min(calc(100% - 2rem), var(--page-width, 92rem));
}

.site-nav .ap-project-switcher {
  color: var(--text, #edf2f7);
}

.site-nav .ap-project-identity {
  color: var(--text, #edf2f7);
}

.site-nav .ap-project-switcher > summary:hover,
.site-nav .ap-project-switcher > summary:focus-visible,
.site-nav .ap-project-switcher[open] > summary {
  background: var(--accent-soft, #252c36);
  border-color: var(--accent-border, #3a4552);
}

@media (max-width: 68rem) {
  .ap-project-bar__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.45rem 0;
  }

  .ap-project-bar__context {
    max-width: 100%;
    width: 100%;
  }

  .ap-project-switcher__menu {
    max-width: calc(100vw - 2rem);
  }

  .site-nav .ap-project-identity-group {
    display: inline-flex;
    margin: 0;
  }

  .site-nav .ap-project-switcher {
    display: inline-block;
    margin: 0;
  }
}

@media (max-width: 52rem) {
  .site-nav .ap-project-identity-group {
    margin-bottom: 0.4rem;
  }

  .site-nav .ap-project-switcher {
    margin-top: 0.4rem;
  }
}
