.public-theme-toggle {
  position: fixed;
  top: 50%;
  right: 22px;
  z-index: 80;
  width: 46px;
  height: 46px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--main-color);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.public-theme-panel {
  position: fixed;
  top: calc(50% - 24px);
  right: 78px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.public-theme-panel button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.public-theme-panel__reset {
  width: auto !important;
  padding: 0 12px;
  border-radius: var(--radius-pill) !important;
  background: var(--bg-gray) !important;
  color: var(--text-gray);
}

.public-header-placeholder {
  display: block;
}

.public-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 6px 22px rgba(18, 38, 63, .06);
  backdrop-filter: blur(12px);
  transition: box-shadow .25s ease;
}

.public-header__inner {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 88px;
  transition: min-height .25s ease;
}

.public-header.is-compact .public-header__inner {
  min-height: 68px;
}

.public-header__brand,
.public-header__logo,
.public-header__logo-img {
  display: inline-flex;
  align-items: center;
}

.public-header__logo-img {
  width: auto;
  max-width: 210px;
  height: 50px;
  object-fit: contain;
  transition: height .25s ease;
}

.public-header.is-compact .public-header__logo-img {
  height: 40px;
}

.public-header__logo {
  min-height: 50px;
  color: #0f3460;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  transition: min-height .25s ease, font-size .25s ease;
}

.public-header.is-compact .public-header__logo {
  min-height: 40px;
  font-size: 22px;
}

.public-header__nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  min-width: 0;
}

.public-header__nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-black);
  font-size: 15px;
  white-space: nowrap;
}

.public-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--main-color);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}

.public-header__nav a:hover,
.public-header__nav a.is-active,
.public-header__mobile-nav a.is-active {
  color: var(--main-color);
}

.public-header__nav a:hover::after,
.public-header__nav a.is-active::after {
  transform: scaleX(1);
}

.public-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-header__search {
  display: flex;
  align-items: center;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-pill);
  background: #fff;
}

.public-header__search input {
  width: 150px;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
}

.public-header__search button,
.public-header__consult {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--main-color);
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
}

.public-header__search button {
  border-radius: 0;
}

.public-header__consult:hover,
.public-header__search button:hover {
  opacity: .86;
}

.public-header__menu {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-line);
  border-radius: 50%;
  background: #fff;
}

.public-header__menu span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text-black);
}

.public-header__mobile {
  border-top: 1px solid var(--border-line);
  background: #fff;
}

.public-header__mobile-nav {
  display: grid;
  gap: 2px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.public-header__mobile-nav a {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-line);
}

@media (max-width: 1180px) {
  .public-header__inner {
    grid-template-columns: 200px minmax(0, 1fr) auto;
    gap: 20px;
  }

  .public-header__nav {
    gap: 18px;
  }

  .public-header__search input {
    width: 120px;
  }
}

@media (max-width: 991px) {
  .public-header__inner {
    grid-template-columns: 1fr auto;
  }

  .public-header__nav,
  .public-header__search {
    display: none;
  }

  .public-header__menu {
    display: inline-block;
  }
}

@media (max-width: 767px) {
  .public-header__inner {
    min-height: 70px;
  }

  .public-header__logo {
    min-height: 40px;
    font-size: 21px;
  }

  .public-header__logo-img {
    max-width: 180px;
    height: 40px;
  }

  .public-theme-toggle {
    right: 14px;
    width: 38px;
    height: 38px;
  }

  .public-theme-panel {
    right: 58px;
    max-width: calc(100vw - 78px);
    gap: 7px;
    padding: 8px;
  }

  .public-theme-panel button {
    width: 26px;
    height: 26px;
  }

  .public-header__consult {
    height: 38px;
    padding: 0 14px;
    font-size: 14px;
  }
}
