.header-bar {
  min-height: 98px; margin: 0 !important; padding: 22px 0 !important;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: flex-start; gap: 18px;
  border-bottom: 1px solid var(--ink) !important;
}
.header-bar .logo-nbm { width: 30px !important; height: 30px !important; object-fit: contain; margin-left: auto; }
.header-bar .signed-in-status {
  margin: 0; color: var(--muted); font-size: 12px;
  line-height: 1.4; overflow-wrap: anywhere; flex: 1 0 100%;
}
.tool-home-link {
  order: 0; flex: 0 0 auto; min-height: 44px;
  display: inline-flex; align-items: center; padding: 0;
  color: var(--ink); text-decoration: none;
}
.tool-home-link .site-logo { transition: opacity 160ms ease, transform 160ms ease; }
.tool-home-link:hover .site-logo,
.tool-home-link:focus-visible .site-logo { opacity: .82; transform: translateY(-1px); }
.tool-home-link:active .site-logo { transform: scale(.985); }
.tool-nav { display: flex; flex-wrap: wrap; gap: 0 26px; border-bottom: 1px solid var(--line); }
.tool-nav a {
  display: inline-flex; min-height: 50px; align-items: center;
  padding: 12px 0; border-bottom: 3px solid transparent;
  color: var(--muted); font-size: 13px; text-decoration: none;
}
.tool-nav a:hover { color: var(--accent); }
.tool-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tool-switcher { position: relative; order: 3; }
.tool-switcher summary { cursor: pointer; padding: 12px; min-height: 44px; font-size: 13px; list-style-position: inside; }
.tool-switcher-menu { position: absolute; top: calc(100% + 8px); right: 0; width: min(300px, calc(100vw - 32px)); padding: 10px 16px; background: var(--paper); border: 1px solid var(--ink); }
.tool-switcher-menu a { display: flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 14px; }
.tool-switcher-menu a:hover { color: var(--accent); }
.tool-switcher-menu a[aria-current="page"] { font-weight: 500; color: var(--accent); }
.tool-switcher-menu .signed-in-status { padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; color: var(--muted); }
.tool-nav a { position: relative; }
.tool-nav a::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 180ms ease;
}
.tool-nav a:hover::after, .tool-nav a:focus-visible::after, .tool-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-header {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--ink);
}

.site-brand {
  display: inline-flex;
  align-items: center;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
}

.header-links a {
  padding-block: 12px;
  text-decoration: none;
}

.header-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 5px;
}


/* One image box on every page; never size against an intrinsic link width. */
.site-brand { flex: 0 0 auto; }
.site-logo { display: block; width: 235px; height: 40px; object-fit: contain; object-position: left center; }
@media (max-width: 640px) {
  .site-logo { width: 170px; height: 30px; }
  .header-bar { min-height: 80px; gap: 12px; padding-block: 16px !important; }
  .header-bar .logo-nbm { display: none; }
  .tool-home-link { margin-left: 0; }
  .tool-nav { gap: 0 20px; }
  .tool-nav a { font-size: 12px; min-height: 46px; }
}

@media (max-width: 480px) {
  .site-header {
    min-height: 80px;
    gap: 14px;
  }

.header-links {
    gap: 0;
    font-size: 12px;
  }

  .header-links .directory-link {
    display: none;
  }

}
