/* Native language buttons share one GTranslate popup. */
.chinowa_language_backend .gt_switcher-popup { display: none; }
.chinowa_language_button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  min-width: 2.4rem;
  min-height: 2.4rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: #4f4643;
  cursor: pointer;
  font: inherit;
  line-height: 1.4;
  pointer-events: auto;
}
.chinowa_language_icon { display: block; flex: none; width: 2.4rem; height: 2.4rem; }
.chinowa_language_button:focus-visible { outline: 2px solid #9f6757; outline-offset: 4px; }
.chinowa_language_button:disabled { cursor: wait; }
.pg_top .ly_header:not(.is_view) .chinowa_language_button { color: #fff; }
.chinowa_footer_language { margin-top: 2rem; }
.chinowa_language_button--footer { min-height: 4.4rem; font-size: 1.4rem; }
.chinowa_language_button--footer .chinowa_language_icon { width: 1.8rem; height: 1.8rem; }
.chinowa_language_label { font-size: inherit; }
/* GTranslate updates html lang when translating and restores ja on return.
   Override existing break-all in links, TOC and case titles only for English. */
html:lang(en) body,
html:lang(en) body * {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  line-break: auto;
}
html:lang(en) .el_edit a,
html:lang(en) .el_edit_page a,
html:lang(en) #toc_container .toc_list a,
html:lang(en) .el_caseList_ttl {
  white-space: normal;
}

/* Keep full language names visible in the plugin's popup. */
.chinowa_language_backend .gt_white_content {
  width: min(28rem, calc(100vw - 3.2rem));
  height: auto;
  margin: 0;
  transform: translate(-50%, -50%);
}
.chinowa_language_backend .gt_white_content .gt_languages {
  flex-wrap: nowrap;
  max-height: none;
}
@media screen and (max-width: 920px) {
  html:lang(en) .ly_topFv .el_topFv_txtArea {
    width: calc(100% - 3.2rem);
  }
}

/* Remove the inline button baseline gap from the social-icon row. */
.ly_header .el_snsList li { display: flex; align-items: center; }
.ly_header .chinowa_language_button { display: flex; }
/* Keep the footer language control in the legal-link row on desktop. */
.el_footLinks_bottom .el_footLinks_list { align-items: center; }
.el_footLinks_bottom .el_footLinks_list .chinowa_footer_language { margin-top: 0; }
.chinowa_language_button--footer { min-height: 2.4rem; font-size: 1.2rem; }
.chinowa_language_button--footer .chinowa_language_icon { width: 1.6rem; height: 1.6rem; }
@media screen and (max-width: 920px) {
  .el_footLinks_bottom .el_footLinks_list .chinowa_footer_language { width: 100%; margin-top: 1.6rem; }
  .chinowa_language_button--footer { min-height: 4.4rem; font-size: 1.4rem; }
  .chinowa_language_button--footer .chinowa_language_icon { width: 1.8rem; height: 1.8rem; }
}

/* Match the actual text line boxes, not only each list item's outer box. */
@media screen and (min-width: 921px) {
  .el_footLinks_bottom .el_footLinks_list > li { display: flex; align-items: center; }
  .el_footLinks_bottom .el_footLinks_list a {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    line-height: 1.4;
  }
}
