.language-picker {
  position: relative;
  flex: 0 0 auto;
  z-index: 30;
  color: #d0d0d6;
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 108px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(22, 22, 24, 0.92);
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.language-trigger:hover,
.language-picker[data-open="true"] .language-trigger {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: #222225;
}

.language-trigger svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

.language-trigger .language-chevron { width: 14px; height: 14px; }
.language-picker[data-open="true"] .language-chevron { transform: rotate(180deg); }

.language-menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: 184px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 17px;
  background: #18181b;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18), 0 20px 48px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transform-origin: top right;
  transition-property: opacity, transform;
}

.language-picker[data-open="true"] .language-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #d0d0d6;
  font: inherit;
  font-size: 0.77rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition-property: background, color;
}

.language-option::after {
  content: '';
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3.2 3.2L13 4.5' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
}

.language-option[aria-checked="true"] { color: #fff; background: rgba(255, 255, 255, 0.065); }
.language-option[aria-checked="true"]::after { opacity: 1; }
.language-option:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.language-trigger:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.language-option:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

.site-preferences {
  display: flex;
  justify-content: flex-end;
  margin: -24px 0 20px;
}

@media (max-width: 760px) {
  .site-preferences { margin: 0 0 14px; }
  .language-trigger { min-height: 44px; }
  .language-option { min-height: 44px; }
}

@media (prefers-reduced-motion: no-preference) {
  .language-trigger { transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out; }
  .language-trigger:active { transform: scale(0.96); }
  .language-chevron { transition: transform 180ms ease-out; }
  .language-menu { transition: opacity 160ms ease-out, transform 160ms ease-out, visibility 0s 160ms; }
  .language-picker[data-open="true"] .language-menu { transition-delay: 0s; }
  .language-option { transition: background 120ms ease-out, color 120ms ease-out; }
}

@media (forced-colors: active) {
  .language-trigger, .language-menu { border-color: ButtonText; }
  .language-trigger:focus-visible, .language-option:focus-visible { outline-color: Highlight; }
  .language-option[aria-checked="true"] { border: 1px solid Highlight; }
  .language-option[aria-checked="true"]::after { background: Highlight; }
}
