/* One platform header. Deliberate specificity overrides legacy profile/page
   header rules without altering their page content or permission checks. */
html body .rc-site header.rc-topbar.rc-topbar {
  position: fixed !important;
  inset: 0 0 auto !important;
  width: 100% !important;
  height: 78px !important;
  min-height: 78px !important;
  padding: 8px 16px !important;
  box-sizing: border-box !important;
  transform: none !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  z-index: 5000;
  color: #111827;
  font-family: Inter, PhiloInter, system-ui, sans-serif !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-topbar__inner.rc-topbar-inner {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 1240px !important;
  height: 62px !important;
  min-height: 62px !important;
  margin: 0 auto !important;
  padding: 8px 20px !important;
  box-sizing: border-box !important;
  position: relative !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-logo {
  order: 0 !important;
  flex: 0 0 auto !important;
  margin: 0 18px 0 0 !important;
  padding: 0 !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 30px !important;
  letter-spacing: -.6px !important;
  white-space: nowrap !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-main-menu {
  order: 1 !important;
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  gap: 20px !important;
  margin: 0 !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-main-menu a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 21px !important;
  text-decoration: none !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-main-menu a[aria-current="page"] {
  text-decoration: none !important;
  text-underline-offset: 7px;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-search.rc-search-wrap {
  order: 2 !important;
  display: flex !important;
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  flex: 1 1 240px !important;
  width: auto !important;
  min-width: 100px !important;
  max-width: none !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #f9fafb !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 24px !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-search > .rc-search-icon { display: none !important; }
html body .rc-site header.rc-topbar.rc-topbar .rc-search > input {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: 0 14px 0 40px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 24px !important;
  background: transparent !important;
  box-shadow: none !important;
  font: 400 14px/21px Inter, PhiloInter, system-ui, sans-serif !important;
  color: #111827 !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-search > button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  inset: 0 auto 0 0 !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #6b7280 !important;
  cursor: pointer;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-top-icons {
  order: 3 !important;
  display: flex !important;
  flex: 0 0 auto !important;
  gap: 8px !important;
  height: 44px !important;
  min-height: 0 !important;
  align-items: center !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-cart-link { order: 4 !important; }
html body .rc-site header.rc-topbar.rc-topbar .rc-user-dropdown { order: 5 !important; width: 36px !important; flex: 0 0 36px !important; }
html body .rc-site header.rc-topbar.rc-topbar .rc-add-dropdown { order: 6 !important; }
html body .rc-site header.rc-topbar.rc-topbar .rc-campus-menu-toggle { order: 7 !important; }
html body .rc-site header.rc-topbar.rc-topbar .rc-top-icon,
html body .rc-site header.rc-topbar.rc-topbar .rc-cart-link,
html body .rc-site header.rc-topbar.rc-topbar .rc-user-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #111827 !important;
  cursor: pointer;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-user-button img { width: 36px !important; height: 36px !important; border-radius: 50% !important; object-fit: cover; }
html body .rc-site header.rc-topbar.rc-topbar .rc-top-icon svg,
html body .rc-site header.rc-topbar.rc-topbar .rc-cart-link svg { width: 20px !important; height: 20px !important; }
html body .rc-site header.rc-topbar.rc-topbar .rc-add-new {
  height: 38px !important;
  padding: 0 16px !important;
  border: 1px solid #111 !important;
  border-radius: 8px !important;
  background: #111 !important;
  color: #fff !important;
  font: 600 14px/21px Inter, PhiloInter, system-ui, sans-serif !important;
}
html body .rc-site header.rc-topbar.rc-topbar .rc-top-icon:is(:hover, [aria-current="page"], [aria-expanded="true"]),
html body .rc-site header.rc-topbar.rc-topbar .rc-cart-link:is(:hover, [aria-current="page"]) { background: #edf1f4 !important; }
html body .rc-site header.rc-topbar.rc-topbar :focus-visible { outline: 2px solid #1d4ed8 !important; outline-offset: 3px !important; }
@media (max-width: 1199px) {
  html body .rc-site header.rc-topbar.rc-topbar .rc-topbar__inner.rc-topbar-inner { gap: 12px !important; padding: 8px 12px !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-main-menu { display: none !important; }
}
@media (max-width: 900px) {
  /* All destinations remain available in the existing mobile navigation. */
  html body .rc-site header.rc-topbar.rc-topbar .rc-cart-link { display: none !important; }
}
@media (max-width: 767px) {
  html body .rc-site header.rc-topbar.rc-topbar { height: 64px !important; min-height: 64px !important; padding: 4px 8px !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-topbar__inner.rc-topbar-inner { height: 56px !important; min-height: 56px !important; padding: 4px 8px !important; gap: 4px !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-logo { font-size: 16px !important; letter-spacing: -.4px !important; margin: 0 !important; flex: 1 1 auto !important; min-width: 0 !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-search.rc-search-wrap { flex: 0 0 40px !important; min-width: 40px !important; width: 40px !important; height: 44px !important; border: 0 !important; background: #fff !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-search > button { height: 44px !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-search > input { display: none !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-search:focus-within > input,
  html body .rc-site header.rc-topbar.rc-topbar .rc-search[data-mobile-search-open="1"] > input { display: block !important; position: fixed !important; inset: 66px 8px auto !important; width: calc(100vw - 16px) !important; height: 44px !important; background: #fff !important; border: 1px solid #e5e7eb !important; padding: 0 16px !important; z-index: 1300 !important; box-sizing: border-box !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-top-icons { gap: 2px !important; }
  html body .rc-site header.rc-topbar.rc-topbar .rc-top-icon,
  html body .rc-site header.rc-topbar.rc-topbar .rc-user-button { height: 44px !important; min-height: 44px !important; }
}

/* Keep keyword results identifiable without changing directory cards. */
html body .rc-site .rc-equipment-search-summary{display:flex;align-items:baseline;flex-wrap:wrap;gap:5px;margin-top:10px!important;font-size:13px!important;color:#4b5563!important}
html body .rc-site .rc-equipment-search-summary a{margin-left:8px;text-decoration:underline;text-underline-offset:3px;color:#111827}

html body .rc-site .rc-directory-keyword{margin-top:10px!important;font-size:13px!important;color:#4b5563!important}
html body .rc-site header.rc-topbar.rc-topbar .rc-main-menu a[aria-current="page"]::after{content:"";position:absolute;left:0;right:0;bottom:1px;height:2px;background:#111827}

/* Keep the existing vertical alphabet in its own gutter on narrower windows. */
@media (max-width: 1399px) {
  html body:has(.rc-experts-page, .rc-equipment-directory-page) :is(.rc-alpha-rail, .rc-platform-alphabet):not(#ph-unused-alpha) {
    right: 8px !important;
    width: 28px !important;
    max-width: 28px !important;
  }
  html body .rc-site main.ph-page-shell section.rc-experts-page.rc-directory-redesign {
    box-sizing: border-box;
    padding-inline-end: 44px !important;
  }
  html body section.rc-equipment-directory-page.rc-directory-redesign:not(#rc-equipment-layout-unused) {
    padding-right: 56px !important;
  }
}

/* The fixed site header also needs flow space when Drupal's admin shell is absent. */
html body:not(.gin--core-navigation):has(.rc-site > header.rc-topbar) .rc-site {
  box-sizing: border-box;
  padding-block-start: 78px !important;
}
@media (max-width: 767px) {
  html body:not(.gin--core-navigation):has(.rc-site > header.rc-topbar) .rc-site {
    padding-block-start: 64px !important;
  }
}
