/* v39: fixes header logo centering and keeps social links on the same row with user actions. */
@media (min-width: 821px) {
  body #app-shell header.site-header {
    grid-template-columns: minmax(250px, auto) minmax(0, 1fr) auto auto !important;
    grid-template-areas: "brand nav socials actions" !important;
    gap: 12px !important;
    align-items: center !important;
  }

  body #app-shell header.site-header .brand {
    grid-area: brand !important;
  }

  body #app-shell header.site-header .site-nav-shell,
  body #app-shell header.site-header nav.site-nav,
  body #app-shell header.site-header .site-nav {
    grid-area: nav !important;
  }

  body #app-shell header.site-header .brand-mark,
  body #app-shell header.site-header .brand .brand-mark,
  body #app-shell header.site-header a.brand .brand-mark {
    position: relative !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: 0 0 40px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-indent: -999px !important;
    line-height: 1 !important;
    font-size: 0 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
  }

  body #app-shell header.site-header .brand-mark::before {
    content: none !important;
    display: none !important;
  }

  body #app-shell header.site-header .brand-mark::after,
  body #app-shell header.site-header .brand .brand-mark::after,
  body #app-shell header.site-header a.brand .brand-mark::after {
    content: 'ЦК' !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-indent: 0 !important;
    color: #114394 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    letter-spacing: -.03em !important;
    text-align: center !important;
    transform: translate(0, 0) !important;
  }

  body #app-shell header.site-header .social-links,
  body #app-shell header.site-header #site-social-links {
    grid-area: socials !important;
    align-self: center !important;
    justify-self: end !important;
    width: auto !important;
    max-width: none !important;
    min-width: max-content !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  body #app-shell header.site-header .social-link,
  body #app-shell header.site-header #site-social-links .social-link,
  body #app-shell header.site-header .social-links a {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex: 0 0 38px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  body #app-shell header.site-header .auth-panel {
    grid-area: actions !important;
    align-self: center !important;
    justify-self: end !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body #app-shell header.site-header .auth-panel > *,
  body #app-shell header.site-header .auth-panel .btn,
  body #app-shell header.site-header .auth-panel a,
  body #app-shell header.site-header .auth-panel button,
  body #app-shell header.site-header .auth-panel span {
    flex: 0 0 auto !important;
  }

  body #app-shell header.site-header .auth-user-name,
  body #app-shell header.site-header .auth-panel span:not(.mobile-nav-icon) {
    max-width: 170px !important;
  }

  @media (max-width: 1500px) {
    body #app-shell header.site-header {
      grid-template-columns: minmax(240px, auto) minmax(0, 1fr) auto !important;
      grid-template-areas:
        "brand nav actions"
        "brand nav socials" !important;
      min-height: 104px !important;
      row-gap: 8px !important;
    }

    body #app-shell header.site-header .auth-panel {
      align-self: end !important;
    }

    body #app-shell header.site-header .social-links,
    body #app-shell header.site-header #site-social-links {
      align-self: start !important;
    }
  }

  @media (max-width: 1280px) {
    body #app-shell header.site-header {
      grid-template-columns: minmax(240px, auto) minmax(0, 1fr) !important;
      grid-template-areas:
        "brand actions"
        "nav socials" !important;
      min-height: 0 !important;
    }

    body #app-shell header.site-header nav.site-nav,
    body #app-shell header.site-header .site-nav {
      justify-content: flex-start !important;
      flex-wrap: nowrap !important;
      overflow-x: auto !important;
      padding-bottom: 2px !important;
    }

    body #app-shell header.site-header .social-links,
    body #app-shell header.site-header #site-social-links {
      justify-self: end !important;
      align-self: center !important;
    }
  }
}

@media (max-width: 820px) {
  body #app-shell header.site-header .brand-mark,
  body #app-shell header.site-header .brand .brand-mark,
  body #app-shell header.site-header a.brand .brand-mark {
    position: relative !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    flex: 0 0 38px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-indent: -999px !important;
    line-height: 1 !important;
    font-size: 0 !important;
    text-align: center !important;
  }

  body #app-shell header.site-header .brand-mark::before {
    content: none !important;
    display: none !important;
  }

  body #app-shell header.site-header .brand-mark::after,
  body #app-shell header.site-header .brand .brand-mark::after,
  body #app-shell header.site-header a.brand .brand-mark::after {
    content: 'ЦК' !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-indent: 0 !important;
    color: #1546a1 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    letter-spacing: -.03em !important;
    text-align: center !important;
    transform: translate(0, 0) !important;
  }
}
