.portal-language-ui,
.portal-language-ui * {
  box-sizing: border-box;
}

.portal-language-ui {
  color: #1c2127;
  font-family: "Source Sans 3", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.portal-language-trigger {
  box-sizing: border-box;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 2147482000;
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid #9ba8b4;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(12, 34, 56, 0.16);
  color: #003256;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.portal-language-trigger.is-inline {
  position: static;
  inset: auto;
  flex: none;
  padding: 7px 10px;
  box-shadow: none;
  font-family: "Source Sans 3", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 12px;
}

.portal-language-trigger:hover {
  border-color: #005ea2;
  background: #f3f7fa;
}

.portal-language-trigger:focus-visible,
.portal-language-close:focus-visible,
.portal-language-option:focus-visible {
  outline: 3px solid #face00;
  outline-offset: 2px;
}

.portal-language-live {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.portal-language-overlay[hidden] {
  display: none !important;
}

.portal-language-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px));
  background: rgba(9, 25, 43, 0.62);
}

.portal-language-dialog {
  width: min(100%, 440px);
  max-height: min(680px, calc(100dvh - 40px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #c5cdd5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(5, 24, 43, 0.34);
  padding: 22px;
}

.portal-language-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.portal-language-title {
  margin: 0;
  color: #102538;
  font-size: 23px;
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: -0.2px;
  text-wrap: pretty;
}

.portal-language-close {
  flex: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: -8px -8px 0 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #3d454f;
  font-family: Arial, sans-serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.portal-language-close:hover {
  border-color: #c7d0d9;
  background: #f3f5f7;
}

.portal-language-description {
  margin: 12px 0 0;
  color: #4b5561;
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

.portal-language-options {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.portal-language-option {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #b8c2cc;
  border-radius: 7px;
  background: #ffffff;
  color: #102538;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.portal-language-option:hover {
  border-color: #005ea2;
  background: #f4f8fb;
}

.portal-language-option.is-current {
  border-color: #005ea2;
  box-shadow: inset 4px 0 0 #005ea2;
  background: #eef6fb;
}

.portal-language-option-name {
  font-size: 16px;
  font-weight: 700;
}

.portal-language-option-state {
  min-width: 0;
  color: #005ea2;
  font-size: 12px;
  font-weight: 750;
}

.portal-language-storage-note {
  margin: 16px 0 0;
  border-top: 1px solid #e3e7eb;
  padding-top: 13px;
  color: #66717d;
  font-size: 12.5px;
  line-height: 1.45;
}

html.portal-language-dialog-open {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .portal-language-trigger {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
  }

  .portal-language-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .portal-language-dialog {
    width: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top, 0px)));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .portal-language-dialog {
    max-height: calc(100dvh - 16px);
    padding-block: 16px;
  }

  .portal-language-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-language-option {
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-language-ui *,
  .portal-language-ui *::before,
  .portal-language-ui *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .portal-language-trigger,
  .portal-language-dialog,
  .portal-language-close,
  .portal-language-option {
    border: 1px solid CanvasText;
  }

  .portal-language-option.is-current {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }
}
