.i18n-lang-flag {
  display: inline-block;
  flex-shrink: 0;
  width: 22px;
  height: 15px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  vertical-align: middle;
}

.i18n-lang__switch {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 120;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.i18n-lang__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 26px;
  padding: 0;
  line-height: 1;
  border-radius: 4px;
}

.i18n-lang__current .i18n-lang-flag {
  width: 18px;
  height: 13px;
}

.i18n-language-switcher {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.i18n-language-switcher.active {
  display: grid;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 2px 12px;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  right: auto;
  min-width: 0;
  padding: 10px;
  background: var(--rebt-white);
  border: 1px solid var(--rebt-line-soft);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--rebt-black-a12);
  transform: translateX(-50%);
}

.i18n-language-switcher li {
  margin: 0;
}

.i18n-language-switcher a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--rebt-ink);
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
  background: transparent;
  border-radius: 6px;
  white-space: nowrap;
}

.i18n-language-switcher .i18n-lang-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.i18n-language-switcher a.current {
  background: var(--rebt-teal-soft);
}

@media (hover: hover) {
  .i18n-language-switcher a:hover {
    background: var(--rebt-teal-soft);
  }
}

.l-header__lang {
  display: flex;
  align-items: center;
  margin-left: 8px;
  flex-shrink: 0;
}

@media (min-width: 960px) {
  .l-header__gnav .l-header__lang.pc_,
  .l-fixHeader__gnav .l-header__lang.pc_,
  .-series-right .l-header__lang.pc_ {
    margin-left: 12px;
    margin-right: 0;
  }
}

.l-header__inner {
  position: relative;
}

@media screen and (max-width: 959px) {
  .l-header__lang.pc_ {
    display: none !important;
  }

  .i18n-language-switcher.active {
    top: calc(100% + 6px);
    left: 50%;
    right: auto;
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 16px);
    max-height: min(70vh, calc(100dvh - 72px));
    overflow-x: auto;
    overflow-y: auto;
    transform: translateX(-50%);
  }
}

@media screen and (min-width: 960px) {
  .l-header__lang.sp_ {
    display: none !important;
  }
}
