/* ===== Протокол24 header/auth patch v3.1 ===== */

/* Верхняя тёмная полоса больше не пустая слева */
.p24-topline-inner {
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 24px !important;
}

.p24-topline-left {
  color: rgba(220,231,255,.86);
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.p24-topline-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  white-space: nowrap;
}

.p24-topline-right span {
  color: rgba(220,231,255,.92);
}

.p24-topline-right a {
  color: #fff !important;
  font-weight: 900 !important;
}

/* Основная шапка: бренд слева, навигация по центру, действия справа */
.p24-header-inner {
  display: grid !important;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(260px, 360px) !important;
  align-items: center !important;
  gap: 24px !important;
}

.p24-brand {
  justify-self: start !important;
}

.p24-nav {
  justify-self: center !important;
  justify-content: center !important;
  gap: clamp(14px, 1.4vw, 26px) !important;
}

.p24-actions {
  justify-self: end !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
}

.p24-actions .p24-login {
  color: #10234f !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.p24-actions .p24-btn-primary {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  white-space: nowrap !important;
}

/* После авторизации кнопка "Открыть кабинет" не должна растягивать шапку */
.p24-actions .p24-btn {
  min-width: 160px;
}

/* На средних экранах слегка уплотняем */
@media (max-width: 1280px) {
  .p24-header-inner {
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(230px, 320px) !important;
    gap: 18px !important;
  }

  .p24-nav {
    gap: 14px !important;
  }

  .p24-actions .p24-btn {
    min-width: 150px;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

/* Планшет и мобильная */
@media (max-width: 980px) {
  .p24-topline-inner {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px 18px !important;
    padding: 8px 0 !important;
    text-align: center !important;
  }

  .p24-topline-left {
    width: 100%;
    white-space: normal;
  }

  .p24-topline-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    white-space: normal;
  }

  .p24-header-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
  }

  .p24-nav {
    display: none !important;
  }

  .p24-actions {
    margin-left: auto !important;
  }

  .p24-actions .p24-login {
    display: none !important;
  }

  .p24-actions .p24-btn {
    min-width: 0;
    min-height: 44px;
    padding-left: 16px !important;
    padding-right: 16px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 520px) {
  .p24-brand span:last-child {
    display: none;
  }

  .p24-actions .p24-btn {
    max-width: 190px;
  }
}