
.lang-switch {
  position: relative;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 9px 0 8px;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  background: var(--white, #fff);
  color: var(--gray-600, #4b5563);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.lang-switch__btn:hover {
  border-color: rgba(4, 74, 165, .35);
  color: var(--navy, #044aa5);
  background: var(--navy-muted, #e8eef7);
}
.lang-switch__btn:focus-visible {
  outline: none;
  border-color: var(--navy, #044aa5);
  box-shadow: 0 0 0 3px rgba(4, 74, 165, .18);
}
.lang-switch.is-open .lang-switch__btn {
  border-color: rgba(4, 74, 165, .45);
  color: var(--navy, #044aa5);
  background: var(--navy-muted, #e8eef7);
}

.lang-switch__flag {
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, .10), 0 1px 2px rgba(17, 24, 39, .12);
}
.lang-switch__flag svg { display: block; width: 100%; height: 100%; }

.lang-switch__code { font-variant-numeric: tabular-nums; }

.lang-switch__caret {
  flex: 0 0 auto;
  opacity: .55;
  transition: transform .18s cubic-bezier(.4, 0, .2, 1), opacity .16s ease;
}
.lang-switch__btn:hover .lang-switch__caret { opacity: .9; }
.lang-switch.is-open .lang-switch__caret { transform: rotate(180deg); opacity: 1; }

.lang-switch__menu {
  display: none;
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 300;
  min-width: 186px;
  padding: 6px;
  margin: 0;
  list-style: none;
  background: var(--white, #fff);
  border: 1px solid rgba(17, 24, 39, .07);
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(17, 24, 39, .06),
    0 16px 40px -12px rgba(4, 74, 165, .30);
}
.lang-switch.is-open .lang-switch__menu {
  display: block;
  animation: langMenuIn .16s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.lang-switch__menu::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 14px;
  width: 9px;
  height: 9px;
  background: var(--white, #fff);
  border-left: 1px solid rgba(17, 24, 39, .07);
  border-top: 1px solid rgba(17, 24, 39, .07);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

.lang-switch__menu li { margin: 0; }
.lang-switch__menu li + li { margin-top: 1px; }

.lang-switch__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--gray-700, #374151);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color .13s ease, color .13s ease;
}
.lang-switch__item:hover { background: var(--gray-50, #f9fafb); }
.lang-switch__item:focus-visible {
  outline: none;
  background: var(--navy-muted, #e8eef7);
  color: var(--navy, #044aa5);
}
.lang-switch__item-label { flex: 1 1 auto; }

.lang-switch__item.is-active {
  color: var(--navy, #044aa5);
  font-weight: 600;
  background: rgba(4, 74, 165, .06);
}
.lang-switch__check { flex: 0 0 auto; opacity: 0; transition: opacity .13s ease; }
.lang-switch__item.is-active .lang-switch__check { opacity: 1; }

.home-page .lang-switch__btn,
.lang-switch--on-dark .lang-switch__btn {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .85);
}
.home-page .lang-switch__btn:hover,
.home-page .lang-switch.is-open .lang-switch__btn,
.lang-switch--on-dark .lang-switch__btn:hover,
.lang-switch--on-dark.is-open .lang-switch__btn {
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.home-page .lang-switch__btn:focus-visible,
.lang-switch--on-dark .lang-switch__btn:focus-visible {
  border-color: rgba(6, 160, 250, .8);
  box-shadow: 0 0 0 3px rgba(6, 160, 250, .3);
}
.home-page .lang-switch__flag,
.lang-switch--on-dark .lang-switch__flag {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .4);
}

.home-page .lang-switch__menu,
.lang-switch--on-dark .lang-switch__menu {
  background: #0b1428;
  border-color: rgba(255, 255, 255, .10);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .5),
    0 18px 44px -12px rgba(0, 0, 0, .75);
}
.home-page .lang-switch__menu::before,
.lang-switch--on-dark .lang-switch__menu::before {
  background: #0b1428;
  border-left-color: rgba(255, 255, 255, .10);
  border-top-color: rgba(255, 255, 255, .10);
}

.home-page .lang-switch__item,
.lang-switch--on-dark .lang-switch__item {
  color: rgba(255, 255, 255, .78);
}
.home-page .lang-switch__item:hover,
.lang-switch--on-dark .lang-switch__item:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}
.home-page .lang-switch__item:focus-visible,
.lang-switch--on-dark .lang-switch__item:focus-visible {
  background: rgba(6, 160, 250, .16);
  color: #fff;
}
.home-page .lang-switch__item.is-active,
.lang-switch--on-dark .lang-switch__item.is-active {
  color: #06A0FA;
  background: rgba(6, 160, 250, .12);
}

.home-page .lang-switch__ns button,
.lang-switch--on-dark .lang-switch__ns button {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .85);
}
.home-page .lang-switch__ns button.is-active,
.lang-switch--on-dark .lang-switch__ns button.is-active {
  border-color: rgba(6, 160, 250, .7);
  background: rgba(6, 160, 250, .14);
  color: #06A0FA;
}

.lang-switch__ns { display: flex; gap: 4px; }
.lang-switch__ns button {
  padding: 7px 9px;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  background: var(--white, #fff);
  color: var(--gray-600, #4b5563);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
}
.lang-switch__ns button.is-active {
  border-color: var(--navy, #044aa5);
  color: var(--navy, #044aa5);
  background: var(--navy-muted, #e8eef7);
}
.lang-switch:has(.lang-switch__ns) .lang-switch__btn,
.lang-switch:has(.lang-switch__ns) .lang-switch__menu { display: none; }

.cr-top__inner .lang-switch,
.rt-top__inner .lang-switch,
.tf-top__inner .lang-switch,
.co-top__inner .lang-switch,
.hs-top__inner .lang-switch,
.dhc-top__inner .lang-switch,
.ms-top .lang-switch { margin-left: auto; }

@media (max-width: 480px) {
  .lang-switch__code { display: none; }
  .lang-switch__btn { padding: 0 7px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch.is-open .lang-switch__menu { animation: none; }
  .lang-switch__caret { transition: none; }
}
