/* Desktop header placement and first-paint pulse ownership. */
@media (min-width: 981px) {
  /* Prevent any legacy energy canvas from ever becoming a visible peer of the
     canonical v17 renderer during startup or later DOM refreshes. */
  .sidebar > canvas[class*="site-energy-network-canvas"]:not(.site-energy-network-canvas-v17) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .sidebar > .site-energy-network-canvas-v17 {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* The desktop header visually belongs to the map side of the 318px rail.
     Position its three elements directly instead of letting older grid rules
     compete during startup. */
  .header {
    position: relative !important;
    display: block !important;
    padding: 10px 18px 10px 334px !important;
  }

  .header .brand {
    position: absolute !important;
    z-index: 3 !important;
    left: 352px !important;
    top: 50% !important;
    width: 232px !important;
    height: 60px !important;
    display: block !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) !important;
  }

  .header .brand img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    object-position: left center !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .header .map-instruction {
    position: absolute !important;
    z-index: 2 !important;
    left: calc(50% + 167px) !important;
    top: 50% !important;
    width: 430px !important;
    max-width: 430px !important;
    margin: 0 !important;
    color: #17366f !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    text-align: center !important;
    white-space: nowrap !important;
    transform: translate(-50%, -50%) !important;
  }

  .header .search {
    position: absolute !important;
    z-index: 3 !important;
    right: 18px !important;
    top: 50% !important;
    width: 378px !important;
    max-width: 378px !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
  }

  .header .search input {
    height: 42px !important;
    padding: 0 36px 0 40px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
  }

  .header .search svg {
    left: 13px !important;
    top: 12px !important;
    width: 18px !important;
    height: 18px !important;
  }

  .header .clear-search {
    right: 7px !important;
    top: 7px !important;
    width: 28px !important;
    height: 28px !important;
  }

  /* Keep the mission statement centered without colliding with the wider search
     on moderately narrow desktop windows. */
  @media (max-width: 1380px) {
    .header .map-instruction {
      width: 300px !important;
      max-width: 300px !important;
      font-size: 12.5px !important;
    }
  }
}
