/* Compact language switcher in the existing Scalpy header. */
#languageButton {
  box-sizing: border-box;
  width: 104px;
  min-width: 104px;
  height: 36px;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #b98a00;
  border-radius: 8px;
  background: linear-gradient(145deg, #122237, #0c1727);
  box-shadow: inset 0 1px 0 #ffffff12, 0 0 0 1px #ffc4000c;
}

#languageButton:hover,
#languageButton:focus-visible,
#languageButton[aria-expanded="true"] {
  outline: none;
  border-color: #ffc400;
  background: linear-gradient(145deg, #172b43, #101d2f);
  box-shadow: inset 0 1px 0 #ffffff19, 0 0 0 2px #ffc40024;
}

#languageButton .scalpy-language-current-flag {
  display: block;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  box-sizing: border-box;
  border: 1px solid #ffffff32;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #06101d, 0 2px 5px #0008;
}

#languageButton .scalpy-language-code {
  min-width: 0;
  color: #f3f6fc;
  font: 700 14px/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

#languageButton .scalpy-chevron {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-color: #a9bfd3;
  transform: rotate(45deg) translateY(-2px);
}

#languageButton[aria-expanded="true"] .scalpy-chevron {
  transform: rotate(225deg) translateY(-2px);
}

#languageMenu {
  width: 250px;
  padding: 7px;
  border: 1px solid #38516b;
  border-radius: 12px;
  background: linear-gradient(155deg, #102237, #091624 82%);
  box-shadow: 0 18px 42px #000b, inset 0 1px 0 #ffffff0d;
}

#languageMenu::before {
  top: -7px;
  right: 42px;
  width: 12px;
  height: 12px;
  border-color: #38516b;
  background: #102237;
}

#languageMenu .scalpy-language-option {
  box-sizing: border-box;
  min-height: 58px;
  padding: 7px 9px;
  grid-template-columns: 34px minmax(0, 1fr) 19px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background .15s, border-color .15s;
}

#languageMenu .scalpy-language-option + .scalpy-language-option {
  margin-top: 4px;
  border-top-color: transparent;
}

#languageMenu .scalpy-language-option:hover,
#languageMenu .scalpy-language-option:focus-visible {
  outline: none;
  border-color: #42617d;
  background: #182b3e;
}

#languageMenu .scalpy-language-option.selected {
  border-color: #81631b;
  background: linear-gradient(100deg, #4537175c, #1830475c 78%);
  box-shadow: inset 0 1px 0 #ffdc6c1b;
}

#languageMenu .scalpy-language-visual {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
}

#languageMenu .scalpy-language-visual .scalpy-flag {
  display: block;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  border: 1px solid #ffffff35;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #071423, 0 2px 7px #0008;
}

#languageMenu .scalpy-language-option > span:nth-child(2) {
  gap: 3px;
}

#languageMenu .scalpy-language-option strong {
  color: #edf4fc;
  font: 700 14px/1.15 Arial, Helvetica, sans-serif;
}

#languageMenu .scalpy-language-option small {
  color: #91a8c0;
  font: 600 11px/1 Arial, Helvetica, sans-serif;
}

#languageMenu .scalpy-language-option > i {
  visibility: hidden;
  color: #ffc400;
  font: 800 20px/1 Arial, Helvetica, sans-serif;
}

#languageMenu .scalpy-language-option.selected > i {
  visibility: visible;
}

@media (min-width: 681px) {
  .scalpy-action-dock #languageButton {
    width: 104px;
    min-width: 104px;
  }

  .scalpy-action-dock #languageMenu {
    top: 43px;
    right: 0;
    width: 250px;
    padding: 7px;
  }

  .scalpy-action-dock #languageMenu .scalpy-language-option {
    min-height: 58px;
    padding: 7px 9px;
    grid-template-columns: 34px minmax(0, 1fr) 19px;
    gap: 10px;
    border-radius: 8px;
  }

  .scalpy-action-dock #languageMenu .scalpy-language-visual {
    width: 34px;
    height: 34px;
    border-radius: 50%;
  }

  .scalpy-action-dock #languageMenu .scalpy-language-option strong { font-size: 14px; }
  .scalpy-action-dock #languageMenu .scalpy-language-option small { font-size: 11px; }
}

@media (max-width: 680px) {
  #languageButton {
    width: 94px;
    min-width: 94px;
    height: 38px;
    margin: 0 4px 0 0;
    padding: 0 8px;
  }

  #languageMenu {
    position: fixed;
    top: 58px;
    right: 9px;
    left: auto;
    width: min(300px, calc(100vw - 18px));
  }
}
