/* 언어 전환 + 글씨 크기 조절 (A안·B안 공통) */
.i18n-switch,
.i18n-zoom,
.i18n-design {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}
.i18n-switch button,
.i18n-zoom button,
.i18n-design a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  padding: 5px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}
.i18n-switch button:hover,
.i18n-zoom button:not(:disabled):hover,
.nav .i18n-design a:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.i18n-switch button[aria-pressed='true'] { background: #fff; color: #10233f; }
.i18n-switch button:focus-visible,
.i18n-zoom button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.i18n-switch .flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  display: block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  background: #fff;
}

/* 글씨 크기 */
.i18n-zoom button { font-size: 14.5px; padding: 5px 7px; }
.i18n-zoom button:disabled { opacity: 0.38; cursor: default; }
.i18n-zoom .zoom-val {
  font-size: 13px;
  font-weight: 700;
  min-width: 38px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  font-variant-numeric: tabular-nums;
}

/* 밝은 배경의 내비게이션(B안) */
.nav.light .i18n-switch,
.nav.light .i18n-zoom {
  background: rgba(16, 35, 63, 0.07);
  border-color: rgba(16, 35, 63, 0.16);
}
.nav.light .i18n-switch button,
.nav.light .i18n-zoom button,
.nav.light .i18n-zoom .zoom-val { color: rgba(16, 35, 63, 0.74); }
.nav.light .i18n-switch button:hover,
.nav.light .i18n-zoom button:not(:disabled):hover { background: rgba(16, 35, 63, 0.09); color: #10233f; }
.nav.light .i18n-switch button[aria-pressed='true'] { background: #10233f; color: #fff; }
.nav.light .i18n-switch button:focus-visible,
.nav.light .i18n-zoom button:focus-visible { outline-color: #10233f; }

/* 메뉴 줄과 언어·글씨 줄을 항상 나눕니다 */
.nav-in { flex-wrap: wrap; height: auto; padding: 0 0 10px; row-gap: 0; align-items: center; }
/* 언어 줄이 위, 메뉴 줄이 아래 */
.nav-tools {
  order: -1;
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.nav.light .nav-tools { border-bottom-color: rgba(16, 35, 63, 0.12); }
/* 메뉴가 길어져도 브랜드와 신청 버튼이 같은 줄에 남도록 */
.nav .nav-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav .nav-links::-webkit-scrollbar { display: none; }
.nav-tools .i18n-switch { flex: 1 1 auto; margin-left: 0; }
.nav-tools .i18n-zoom,
.nav-tools .i18n-design { flex: 0 0 auto; margin-left: 0; }
.i18n-switch button { flex: 1 1 0; justify-content: center; padding: 7px 6px; }

/* 글씨를 키우면 화면이 좁아진 것과 같으므로 같은 줄바꿈 규칙을 씁니다 */

@media (max-width: 720px) {
  .i18n-switch { width: 100%; flex: 1 1 100%; margin-bottom: 6px; }
  .i18n-zoom { order: 6; margin: 0 0 8px; }
  .i18n-switch button span { display: none; } /* 좁은 화면에서는 국기만 */
  .i18n-switch .flag { width: 22px; height: 15px; }
  .i18n-switch button { padding: 6px 4px; }
}

/* A안 / B안 디자인 전환 */
.nav .i18n-design a { text-decoration: none; font-size: 14px; }
.nav .i18n-design a[aria-current='page'] { background: #fff; color: #10233f; }
.nav.light .i18n-design { background: rgba(16, 35, 63, 0.07); border-color: rgba(16, 35, 63, 0.16); }
.nav.light .i18n-design a { color: rgba(16, 35, 63, 0.74); }
.nav.light .i18n-design a:hover { background: rgba(16, 35, 63, 0.09); color: #10233f; }
.nav.light .i18n-design a[aria-current='page'] { background: #10233f; color: #fff; }
@media (max-width: 720px) { .i18n-design { order: 7; margin: 0 0 8px 6px; } }

/* 좁은 폭에서 제목이 메뉴와 겹치지 않도록 */
.nav .nav-brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 언어를 바꿔도 글자가 칸을 넘지 않도록 ─────────────────
   한국어는 단어 단위 줄바꿈(keep-all)이 읽기 좋지만,
   일본어·중국어·러시아어에서는 줄바꿈이 막혀 글자가 칸 밖으로 나갑니다. */
html:not([lang='ko']) body,
html:not([lang='ko']) .opening-paper,
html:not([lang='ko']) .fact-main,
html:not([lang='ko']) .fact-detail {
  word-break: normal;
  overflow-wrap: break-word;
}
html[lang='ja'] body,
html[lang='zh-Hans'] body { line-break: normal; }
/* 어느 언어에서든 마지막 안전장치 */
.fact-main, .fact-detail, .steps span, .steps b, .overview dd, .port h3, .tl p { overflow-wrap: anywhere; }

/* 메뉴 줄은 한 줄로 고정 (러시아어처럼 긴 언어에서도 버튼이 밀리지 않게) */
.nav-in { flex-direction: column; align-items: stretch; }
.nav-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-bottom: 10px; row-gap: 6px; }
@media (min-width: 861px) { .nav-main { flex-wrap: nowrap; } }
@media (max-width: 860px) { .nav-main .nav-links { flex: 1 1 100%; width: 100%; overflow-x: auto; } }
.nav-main .nav-brand { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-main .nav-links { flex: 1 1 auto; min-width: 0; }
.nav-main .nav-apply { flex: 0 0 auto; }
.nav .nav-links a { flex: 0 0 auto; }

/* 좁은 화면에서는 도구 줄도 접힙니다 */
.nav-tools { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 860px) {
  .nav-tools { min-width: 0; }
  .nav-tools .i18n-switch { flex: 0 0 100%; width: 100%; min-width: 0; }
  .nav-tools .i18n-zoom,
  .nav-tools .i18n-design { flex: 1 1 calc(50% - 4px); min-width: 0; justify-content: center; }
}

/* 내비게이션 두 줄이 화면 밖으로 넘지 않도록 */
.nav-in { min-width: 0; }
.nav-in > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.nav-main .nav-links { overflow-x: auto; scrollbar-width: none; }
.nav-main .nav-links::-webkit-scrollbar { display: none; }
