.language-selector {
  position: relative;
  color: #c1cfdd;
}
.language-selector summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 4px;
  list-style: none;
  cursor: pointer;
}
.language-selector summary::-webkit-details-marker {
  display: none;
}
.language-selector-caption {
  display: none;
}
.language-selector[open] .nav-chevron {
  transform: translateY(2px) rotate(225deg);
}
.language-options {
  position: absolute;
  z-index: 1;
  inset: calc(100% + 4px) 0 auto auto;
  min-width: 142px;
  padding: 5px;
  background: #0b1724;
  border: 1px solid #3a4d60;
  border-radius: 3px;
  box-shadow: 0 12px 25px #02060b99;
}
.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 6px 10px;
  text-decoration: none;
}
.language-options a:hover,
.language-options a[aria-current="page"] {
  color: #fff;
  background: #162639;
}
.language-options a[aria-current="page"]::after {
  content: "✓";
  color: #acd9f2;
}
.language-selector :focus-visible,
.locale-fallback a:focus-visible {
  outline: 2px solid #b8d9f3;
  outline-offset: 2px;
}
.locale-fallback {
  position: sticky;
  top: 0;
  z-index: 21;
  padding: 8px 5.5%;
  background: #0e1c2a;
  color: #d7e5f2;
  font:
    14px/1.5 system-ui,
    sans-serif;
}
.locale-fallback a {
  margin-inline-start: 0.6em;
  color: #c0e7ff;
  text-decoration: underline;
}
@media (max-width: 800px) {
  .language-selector {
    margin-bottom: 8px;
    border-bottom: 1px solid #3a4d60;
  }
  .language-selector summary {
    padding: 0 13px;
  }
  .language-selector-caption {
    display: inline;
    margin-inline-end: auto;
  }
  .language-options {
    position: static;
    margin-bottom: 8px;
    box-shadow: none;
  }
  .language-options a {
    min-height: 44px;
  }
}

.reading-header .language-selector {
  align-self: center;
  margin: 0;
  border: 0;
}
.reading-header .language-selector summary {
  padding: 0 4px;
}
.reading-header .language-selector-caption {
  display: none;
}
.reading-header .language-options {
  position: absolute;
  margin: 0;
}
.reading-header .language-options a {
  display: flex;
}
@media (max-width: 800px) {
  .reading-header nav:has(.language-selector) {
    width: 100%;
    gap: 4px 16px;
  }
  .reading-header .language-selector {
    margin-inline-start: auto;
  }
  .reading-header nav:has(.language-selector) > a:last-child {
    flex-basis: 100%;
  }
}
