/* Sticky site title bar */
.BbxBP[data-top-navigation="true"] {
  position: sticky;
  top: 0;
  z-index: 1100;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Turn the legacy collapsible "menu" section into a real horizontal menu bar */
.menu-strip {
  position: sticky;
  top: 64px;
  z-index: 1090;
}

@media (max-width: 767px) {
  .menu-strip {
    top: 56px;
  }
}

.menu-strip > .mYVXT {
  background: rgba(48, 48, 48, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Remove dropdown controls and title label */
.menu-strip [aria-label^="Expand menu"],
.menu-strip [aria-label^="Collapse menu"],
.menu-strip .zGbri,
.menu-strip .amZmwc,
.menu-strip h2,
.menu-strip .CobnVe,
.menu-strip .Ap4VC {
  display: none !important;
}

/* Hide the left block, keep only links */
.menu-strip .oKdM2c:first-child {
  display: none !important;
}

.menu-strip .oKdM2c + .oKdM2c,
.menu-strip .oKdM2c + .oKdM2c .jXK9ad-SmKAyb,
.menu-strip .oKdM2c + .oKdM2c .tyJCtd {
  width: 100% !important;
  max-width: 100% !important;
}

.menu-strip .oKdM2c + .oKdM2c .tyJCtd {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 8px !important;
}

.menu-strip .oKdM2c + .oKdM2c p {
  margin: 0 !important;
  line-height: 1 !important;
}

/* Link and active item styling */
.menu-strip .oKdM2c + .oKdM2c p .XqQF9c,
.menu-strip .oKdM2c + .oKdM2c p > .C9DxTc,
.menu-strip .oKdM2c + .oKdM2c p .XqQF9c .C9DxTc {
  display: inline-block;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 11pt !important;
  border-radius: 999px;
  padding: 8px 14px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-strip .oKdM2c + .oKdM2c p .XqQF9c:hover .C9DxTc,
.menu-strip .oKdM2c + .oKdM2c p .XqQF9c:focus .C9DxTc,
.menu-strip .oKdM2c + .oKdM2c p .XqQF9c:hover,
.menu-strip .oKdM2c + .oKdM2c p .XqQF9c:focus {
  background-color: rgba(255, 255, 255, 0.18);
}

.menu-strip .oKdM2c + .oKdM2c p > .C9DxTc {
  background-color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

/* Reliable fixed top menu injected by menu-improvements.js */
#codex-top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background: rgba(32, 32, 32, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

#codex-top-nav .codex-top-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#codex-top-nav .codex-top-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
  min-width: 0;
}

#codex-top-nav .codex-top-nav-logo {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  flex: 0 0 auto;
}

#codex-top-nav .codex-top-nav-title {
  color: #ffffff;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 10.5pt;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

#codex-top-nav .codex-top-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#codex-top-nav .codex-top-nav-list li {
  margin: 0;
  padding: 0;
}

#codex-top-nav .codex-top-nav-list a {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 11pt;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

#codex-top-nav .codex-top-nav-list a:hover,
#codex-top-nav .codex-top-nav-list a:focus {
  background-color: rgba(255, 255, 255, 0.18);
}

#codex-top-nav .codex-top-nav-list a.is-active {
  background-color: rgba(255, 255, 255, 0.28);
  font-weight: 700;
}

body.has-codex-top-nav {
  padding-top: 64px;
}

body.has-codex-top-nav .BbxBP[data-top-navigation="true"] {
  display: none !important;
}

body.has-codex-top-nav .menu-strip {
  display: none !important;
}

#codex-home-gap {
  display: block;
  height: 24px;
  background-color: #434343;
}

/* Uniform reference styling on Results page (excluding talks section) */
body.codex-results-page section.codex-results-ref p.zfr3Q.CDt4Ke {
  text-align: left !important;
  line-height: 1.45 !important;
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

body.codex-results-page section.codex-results-ref .C9DxTc {
  color: #000000 !important;
  font-family: Montserrat, Arial, sans-serif !important;
  font-size: 11pt !important;
}

body.codex-results-page section.codex-results-ref a.XqQF9c,
body.codex-results-page section.codex-results-ref .aw5Odc {
  color: #000000 !important;
}

body.codex-results-page section.codex-results-ref .aw5Odc {
  text-decoration: underline !important;
}

@media (max-width: 767px) {
  #codex-top-nav .codex-top-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  #codex-top-nav .codex-top-nav-brand {
    justify-content: center;
  }

  #codex-top-nav .codex-top-nav-title {
    max-width: none;
  }

  #codex-top-nav .codex-top-nav-list {
    justify-content: center;
  }

  body.has-codex-top-nav {
    padding-top: 108px;
  }
}
