/* Shared language menu for both legacy and unified headers. */
html body header .language-menu-host,
html body header.gptishka-unified-header .language-menu-host {
  position: relative !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  isolation: isolate;
  z-index: 120;
}

html body header .language-menu__trigger {
  min-width: 144px !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 7px 12px 7px 9px !important;
  color: rgba(247, 250, 255, 0.96) !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 15px !important;
  background: linear-gradient(135deg, rgba(27, 37, 50, 0.94), rgba(12, 18, 27, 0.94)) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
}

html body header .language-menu__trigger:hover {
  border-color: rgba(43, 224, 151, 0.42) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), 0 0 20px rgba(35, 213, 139, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.11) !important;
  transform: translateY(-1px);
}

html body header .language-menu__trigger:focus-visible {
  outline: 2px solid rgba(51, 230, 158, 0.92) !important;
  outline-offset: 3px !important;
  border-color: rgba(51, 230, 158, 0.55) !important;
}

html body header .language-menu__flag {
  width: 28px !important;
  height: 18px !important;
  flex: 0 0 28px !important;
  display: block !important;
  object-fit: cover !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body header .language-menu__current-name {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
}

html body header .language-menu__chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin: -3px 2px 0 3px !important;
  border-right: 2px solid rgba(219, 228, 242, 0.7);
  border-bottom: 2px solid rgba(219, 228, 242, 0.7);
  transform: rotate(45deg);
  transition: transform 180ms ease, margin 180ms ease;
}

html body header .language-menu-host.open .language-menu__chevron {
  margin-top: 3px !important;
  transform: rotate(225deg);
}

html body header .language-menu__popover,
html body header.gptishka-unified-header .language-menu__popover {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  width: 164px !important;
  min-width: 164px !important;
  display: grid !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 9px !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-8px) scale(0.98) !important;
  transform-origin: top right !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 17px !important;
  background: linear-gradient(145deg, rgba(28, 38, 51, 0.98), rgba(10, 15, 23, 0.98)) !important;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(20px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(135%) !important;
  overflow: visible !important;
  z-index: 1000 !important;
  transition: opacity 170ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 200ms !important;
}

html body header .language-menu__popover::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 25px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(26, 36, 49, 0.98);
  transform: rotate(45deg);
}

html body header .language-menu-host.open .language-menu__popover {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
  transition-delay: 0s !important;
}

html body header .language-menu__option {
  position: relative;
  min-width: 0;
  min-height: 46px !important;
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) 16px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 9px !important;
  color: rgba(231, 237, 247, 0.84) !important;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease !important;
}

html body header .language-menu__option:hover,
html body header .language-menu__option:focus-visible {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  outline: none !important;
}

html body header .language-menu__option.is-active {
  color: #fff !important;
  background: rgba(35, 213, 139, 0.1) !important;
  border-color: rgba(35, 213, 139, 0.22) !important;
}

html body header .language-menu__option-name {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body header .language-menu__check {
  width: 7px;
  height: 12px;
  justify-self: center;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(45deg) translateY(-1px);
}

html body header .language-menu__option.is-active .language-menu__check {
  border-color: #2bdd97;
}

@media (max-width: 680px) {
  html body header .language-menu__trigger {
    min-width: 118px !important;
    min-height: 42px !important;
    padding: 6px 10px 6px 8px !important;
  }

  html body header .language-menu__flag {
    width: 27px !important;
    height: 18px !important;
    flex-basis: 27px !important;
  }

  html body header .language-menu__popover,
  html body header.gptishka-unified-header .language-menu__popover {
    width: min(164px, calc(100vw - 24px)) !important;
    min-width: 0 !important;
    right: 0 !important;
  }
}

@media (max-width: 390px) {
  html body header .language-menu__trigger {
    min-width: 108px !important;
    font-size: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body header .language-menu__trigger,
  html body header .language-menu__chevron,
  html body header .language-menu__popover,
  html body header .language-menu__option {
    transition: none !important;
  }
}
