/* AI Project Universe V6.17 — canonical responsive language control
   Mobile: exactly one 文 trigger. Laptop/Desktop: full language selector only. */

/* Laptop and desktop: keep the readable full selector; never show an icon trigger. */
@media (min-width: 761px) {
  .viewer .viewer__language-control {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: 290px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 2px solid #d6dfed !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #0e1726 !important;
    opacity: 1 !important;
    overflow: hidden !important;
  }
  .viewer .viewer__language-control .viewer__control-icon {
    display: inline-flex !important;
    visibility: visible !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    font-size: 15px !important;
    color: inherit !important;
  }
  .viewer .viewer__language-control .viewer__control-icon::before {
    content: none !important;
    display: none !important;
  }
  .viewer .viewer__language-control::after {
    content: '⌄' !important;
    display: block !important;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    color: inherit !important;
    font-size: 14px !important;
  }
  .viewer #viewerLanguageControl {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    min-width: 160px !important;
    max-width: none !important;
    height: 38px !important;
    padding: 0 24px 0 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: #0e1726 !important;
    -webkit-text-fill-color: #0e1726 !important;
    opacity: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    font: 800 13px/1 system-ui,-apple-system,"Segoe UI",sans-serif !important;
  }
  .viewer #viewerLanguageControl option {
    background: #fff !important;
    color: #0e1726 !important;
  }
  .viewer #apuV617MobileLanguageTrigger,
  .viewer #apuV612LanguageTrigger,
  .viewer .apu-v69-language-button,
  .viewer .apu-v611-language-trigger,
  .viewer .apu-v612-language-trigger,
  .viewer .apu-v617-language-trigger,
  .viewer .apu-v69-language-menu,
  .viewer .apu-v611-language-menu,
  .viewer .apu-v612-language-menu,
  .viewer .apu-v617-language-menu {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Phones: hide the native selector and expose one canonical symbol only. */
@media (max-width: 760px) {
  .viewer .viewer__language-control,
  .viewer #viewerLanguageControl {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  .viewer .apu-v69-language-button:not(#apuV617MobileLanguageTrigger),
  .viewer .apu-v611-language-trigger:not(#apuV617MobileLanguageTrigger),
  .viewer .apu-v612-language-trigger:not(#apuV617MobileLanguageTrigger),
  .viewer .apu-v617-language-trigger:not(#apuV617MobileLanguageTrigger),
  .viewer button[data-apu-language-trigger]:not(#apuV617MobileLanguageTrigger) {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  .viewer #apuV617MobileLanguageTrigger {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 3px solid #111 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
    opacity: 1 !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    font: 900 22px/1 system-ui,-apple-system,"Segoe UI",sans-serif !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }
  .viewer .apu-v617-language-menu {
    position: fixed !important;
    z-index: 2147483647 !important;
    display: none !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    width: min(300px, calc(100vw - 20px)) !important;
    max-height: min(460px, calc(100dvh - 92px)) !important;
    padding: 10px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    border: 3px solid #fff !important;
    border-radius: 14px !important;
    background: #07111f !important;
    background-image: none !important;
    color: #fff !important;
    opacity: 1 !important;
    box-shadow: 0 24px 70px rgba(0,0,0,.72) !important;
  }
  .viewer .apu-v617-language-menu.is-open {
    display: grid !important;
  }
  .viewer .apu-v617-language-option {
    display: grid !important;
    grid-template-columns: 48px minmax(0,1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 50px !important;
    padding: 8px 11px !important;
    border: 1px solid #34516f !important;
    border-radius: 10px !important;
    background: #12243d !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-align: left !important;
    opacity: 1 !important;
    cursor: pointer !important;
  }
  .viewer .apu-v617-language-option:hover,
  .viewer .apu-v617-language-option:focus-visible,
  .viewer .apu-v617-language-option[aria-current="true"] {
    background: #1f5b9c !important;
    border-color: #78b9ff !important;
    outline: none !important;
  }
  .viewer .apu-v617-language-code {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 31px !important;
    padding: 0 5px !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: #07111f !important;
    -webkit-text-fill-color: #07111f !important;
    font: 900 11px/1 system-ui,-apple-system,"Segoe UI",sans-serif !important;
  }
  .viewer .apu-v617-language-name {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font: 800 14px/1.25 system-ui,-apple-system,"Segoe UI",sans-serif !important;
  }
}
