/* A bounded brand extension: the approved logo and scrollable categories stay intact. */
.language-bar {
  display: flex;
  justify-content: flex-end;
  padding: 2px var(--space, 4vw) 5px;
  border-top: 1px solid #354650;
  background: #061b2b;
}
.language-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}
.language-globe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin-right: 7px;
  border: 1px solid #5d5743;
  border-radius: 50%;
}
.language-globe img {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.language-symbol {
  display: inline-flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 5px / 4px;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.86;
  transition:
    transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
    opacity 180ms ease;
}
.language-symbol::before {
  content: attr(data-symbol);
}
.language-switcher a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px / 7px;
  color: #e7d2a1;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.language-switcher a + a::before {
  content: none;
}
.language-switcher a::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.6);
  transform-origin: center;
  transition:
    transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
    opacity 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .language-switcher a:hover {
    color: #fff4d4;
    background: #0a2d40;
    transform: translateY(-1px);
  }
  .language-switcher a:hover .language-symbol {
    transform: rotate(-6deg);
    opacity: 1;
  }
  .language-switcher:hover .language-globe img {
    transform: rotate(18deg);
  }
  .language-switcher a:hover::after {
    opacity: 0.9;
    transform: scaleX(1);
  }
}
.language-switcher a:active {
  transform: scale(0.98);
  transition-duration: 100ms;
}
.language-switcher a[aria-current="true"] {
  color: #061b2b;
  background: #c8a45c;
  font-weight: 700;
}
.language-switcher a[aria-current="true"]::after {
  opacity: 0.85;
  transform: scaleX(1);
}
.language-switcher a:focus-visible {
  outline: 2px solid #e7d2a1;
  outline-offset: 2px;
  transition: none;
  transform: none;
}
.translation-notice {
  margin: 0;
  padding: 10px var(--space, 4vw);
  border-bottom: 1px solid #dce5e7;
  background: #f7f3e9;
  color: #173240;
  font-size: 13px;
  line-height: 1.7;
}
.original-language-label {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
}
html[lang="en"] .primary-nav,
html[lang="ja"] .primary-nav {
  flex-wrap: wrap;
}
html[lang="en"] .main-nav,
html[lang="ja"] .main-nav {
  flex-wrap: wrap;
}
html[lang="en"] .primary-nav > a,
html[lang="ja"] .primary-nav > a {
  white-space: normal;
  text-align: center;
}
html[lang="en"] .page-lead,
html[lang="en"] p {
  overflow-wrap: break-word;
}
html[lang="ja"] {
  line-break: strict;
}
html[lang="ja"] body {
  font-family: "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}
html[lang="zh-Hant"] body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
html[lang="en"] .page-hero h1 {
  font-size: clamp(30px, 3.7vw, 64px);
  line-height: 1.2;
}
@media (min-width: 1101px) {
  html[lang="en"] .primary-nav,
  html[lang="ja"] .primary-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-basis: 100%;
    border-top: 1px solid var(--line);
    padding-top: 4px;
  }
  html[lang="en"] .nav-actions,
  html[lang="ja"] .nav-actions {
    margin-left: auto;
  }
}
@media (max-width: 760px) {
  .language-bar {
    justify-content: center;
    padding: 3px 8px 6px;
  }
  .language-switcher {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
    max-width: 420px;
  }
  .language-globe {
    display: none;
  }
  .language-switcher a {
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 60px;
    padding: 7px 4px 9px;
    font-size: 13px;
  }
  html[lang="en"] .site-header .mobile-navigation:not([hidden]),
  html[lang="ja"] .site-header .mobile-navigation:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }
  html[lang="en"] .site-header .nav-actions .button,
  html[lang="ja"] .site-header .nav-actions .button {
    white-space: normal;
    text-align: center;
    max-width: 142px;
  }
  html[lang="en"] .site-header .category-track a,
  html[lang="ja"] .site-header .category-track a {
    min-width: 112px;
    max-width: 180px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .language-switcher a,
  .language-switcher a:active,
  .language-switcher a:hover,
  .language-switcher a:focus-visible,
  .language-switcher .language-symbol,
  .language-switcher a:hover .language-symbol,
  .language-switcher .language-globe img,
  .language-switcher:hover .language-globe img,
  .language-switcher a::after,
  .language-switcher a:hover::after,
  .language-switcher a[aria-current="true"]::after {
    transform: none;
    transition: none;
  }
}

.language-return-note {
  margin: 0 auto 0 0;
  padding: 8px 12px 8px 0;
  color: #e1ecef;
  font-size: 13px;
  line-height: 1.6;
  align-self: center;
  max-width: 55ch;
}
@media (max-width: 760px) {
  .language-bar {
    flex-wrap: wrap;
  }
  .language-return-note {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 6px 10px;
  }
}

@media (max-width: 760px) {
  html[lang="en"] .service-rail,
  html[lang="ja"] .service-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  html[lang="en"] .service-rail a,
  html[lang="ja"] .service-rail a {
    min-width: 0;
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  html[lang="en"] .service-rail a > div,
  html[lang="ja"] .service-rail a > div {
    min-width: 0;
  }
}

html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4 {
  overflow-wrap: anywhere;
  hyphens: auto;
}
@media (max-width: 760px) {
  html[lang="en"] .facts-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  html[lang="en"] .facts-grid > div {
    min-width: 0;
  }
  html[lang="en"] .selection-list > a {
    gap: 14px;
  }
  html[lang="en"] .selection-list > a > div {
    min-width: 0;
    flex: 1;
  }
  html[lang="en"] .selection-list > a > span,
  html[lang="en"] .selection-list > a > svg {
    flex-shrink: 0;
  }
}

/* An opt-in suggestion: fixed positioning avoids moving the page on detection. */
.language-suggestion {
  position: fixed;
  z-index: 120;
  bottom: 24px;
  left: 24px;
  width: min(410px, calc(100vw - 48px));
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid #c8a45c;
  border-radius: 12px / 9px;
  background: #061b2b;
  color: #edf1ed;
  box-shadow: 0 8px 28px #0005;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.language-suggestion[hidden] {
  display: none;
}
.language-suggestion p {
  margin: 0 0 12px;
  color: #edf1ed;
}
.language-suggestion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.language-suggestion-actions a,
.language-suggestion-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #809099;
  border-radius: 8px / 6px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  color: #edf1ed;
  background: transparent;
  cursor: pointer;
}
.language-suggestion-actions .language-suggestion-accept {
  background: #c8a45c;
  color: #061b2b;
  border-color: #c8a45c;
  font-weight: 700;
}
.language-suggestion-actions a:focus-visible,
.language-suggestion-actions button:focus-visible {
  outline: 2px solid #f1dca8;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  .language-suggestion {
    left: 12px;
    bottom: 24px;
    width: min(410px, calc(100vw - 88px));
    padding: 14px;
  }
  .language-suggestion-actions {
    flex-direction: column;
  }
  .language-suggestion-actions a,
  .language-suggestion-actions button {
    width: 100%;
  }
}

/* User-approved integration: keywords left, compact language tools right. */
.keyword-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 0;
  padding: 0 var(--space, 4vw);
  border-bottom: 1px solid #e4e8e8;
  background: #fff;
}
.keyword-meta > span {
  min-width: 0;
  flex: 1 1 380px;
  padding: 4px 0;
  overflow-wrap: anywhere;
}
.language-bar-compact {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.language-bar-compact .language-switcher {
  flex-wrap: nowrap;
  gap: 2px;
  width: auto;
  max-width: none;
}
.language-bar-compact .language-globe {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
  margin-right: 4px;
  border-color: #c9b784;
}
.language-bar-compact .language-globe img {
  width: 18px;
  height: 18px;
  filter: brightness(0.55);
}
.language-bar-compact .language-symbol {
  flex-basis: 18px;
  width: 18px;
  height: 18px;
  font-size: 10px;
  border-radius: 4px / 3px;
}
.language-bar-compact .language-switcher a {
  flex-direction: row;
  min-height: 44px;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 7px / 5px;
  color: #344e59;
  font-size: 12px;
  line-height: 1.3;
}
.language-bar-compact .language-switcher a[aria-current="true"] {
  background: #eadebe;
  color: #132e3c;
}
.language-bar-compact .language-switcher a:focus-visible {
  outline-color: #6c501e;
}
@media (hover: hover) and (pointer: fine) {
  .language-bar-compact .language-switcher a:hover {
    color: #173747;
    background: #f3ecdc;
  }
}
@media (max-width: 760px) {
  .keyword-meta {
    padding: 0 10px;
    column-gap: 8px;
  }
  .keyword-meta > span {
    flex-basis: 100%;
    font-size: 9px;
    line-height: 1.4;
    padding: 3px 0 0;
  }
  .language-bar-compact {
    width: 100%;
  }
  .language-bar-compact .language-switcher {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1px;
  }
  .language-bar-compact .language-globe {
    display: none;
  }
  .language-bar-compact .language-switcher a {
    flex: 1 1 0;
    padding: 5px 3px;
    font-size: 12px;
  }
  .language-bar-compact .language-symbol {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
    font-size: 9px;
  }
}
