img[src="/assets/logo.png"] {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  min-height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 0 !important;
  transform: scale(1.35);
  transform-origin: center;
  margin-right: -22px !important;
}

/* текст ближе к логотипу */
img[src="/assets/logo.png"] + * {
  margin-left: -18px !important;
}

/* если текст лежит не сразу после img */
.header-wrapper img[src="/assets/logo.png"] {
  margin-right: -24px !important;
}

/* отступ между логотипом и текстом */
img[src="/assets/logo.png"] {
  margin-right: 8px !important;
}

img[src="/assets/logo.png"] + * {
  margin-left: 8px !important;
}

/* Шапка обычная, не закрепляется при прокрутке */
.header-wrapper {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

/* ===== Compact header fix: logo/title/buttons in one line ===== */

.header-wrapper {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  min-height: auto !important;
}

.header-wrapper > div {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.header-wrapper img[src="/assets/logo.png"] {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  transform: none !important;
  margin-right: 6px !important;
}

.header-wrapper img[src="/assets/logo.png"] + * {
  margin-left: 0 !important;
}

/* Главная строка шапки: лого + название слева, кнопки справа */
.header-wrapper .mantine-Group-root {
  align-items: center !important;
}

/* Первый уровень внутри шапки */
.header-wrapper > div > div {
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
}

/* Левая часть с логотипом и названием */
.header-wrapper > div > div > div:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
}

/* Название не уменьшаем, но даём ему ужаться если экран маленький */
.header-wrapper > div > div > div:first-child h1,
.header-wrapper > div > div > div:first-child h2,
.header-wrapper > div > div > div:first-child h3,
.header-wrapper > div > div > div:first-child h4,
.header-wrapper > div > div > div:first-child p,
.header-wrapper > div > div > div:first-child span {
  white-space: nowrap !important;
}

/* Правая часть с кнопками */
.header-wrapper > div > div > div:last-child {
  margin-left: auto !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}

/* Кнопки справа чуть компактнее */
.header-wrapper ._actionIcon_1qevm_17,
.header-wrapper button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
}

/* Мобильная версия */
@media (max-width: 600px) {
  .header-wrapper {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  .header-wrapper > div {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .header-wrapper img[src="/assets/logo.png"] {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    margin-right: 4px !important;
  }

  .header-wrapper > div > div {
    gap: 8px !important;
  }

  .header-wrapper > div > div > div:first-child {
    gap: 4px !important;
  }

  .header-wrapper > div > div > div:last-child {
    gap: 6px !important;
  }

  .header-wrapper ._actionIcon_1qevm_17,
  .header-wrapper button {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }
}

/* ===== Logo SVG spacing fix ===== */

/* Отступ между логотипом и текстом */
img[src*="progressiya_logo_tight.svg"],
img[src*="progressiya_logo.svg"] {
  margin-right: 12px !important;
}

/* Чуть больше воздуха внутри верхней шапки */
.header-wrapper {
  padding-top: 14px !important;
  padding-bottom: 14px !important;
}

/* На телефоне чуть компактнее */
@media (max-width: 600px) {
  img[src*="progressiya_logo_tight.svg"],
  img[src*="progressiya_logo.svg"] {
    margin-right: 9px !important;
  }

  .header-wrapper {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
}
