.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  flex: 0 0 auto;
}

.lang-switch summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0.1rem;
  background: transparent;
  color: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  opacity: 0.58;
}

.lang-switch summary::-webkit-details-marker { display: none; }

.lang-switch summary::after {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  margin-top: -0.08rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}

.lang-switch[open] summary::after {
  margin-top: 0.12rem;
  transform: rotate(-135deg);
}

.lang-switch summary .lang-prefix {
  display: none;
}

.lang-switch summary [data-lang-label],
.lang-switch summary strong {
  font-weight: 500;
}

.lang-switch[open] summary,
.lang-switch summary:hover {
  opacity: 0.9;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 10.5rem;
  margin: 0;
  padding: 0.28rem;
  list-style: none;
  border: 1px solid rgba(20, 45, 55, 0.08);
  border-radius: 0.55rem;
  background: #fff;
  color: #1a2b33;
  box-shadow: 0 10px 24px rgba(16, 36, 48, 0.12);
  z-index: 80;
}

.lang-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.42rem 0.55rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  color: inherit;
}

.lang-menu button:hover,
.lang-menu button[aria-current="true"] {
  background: rgba(15, 80, 120, 0.07);
}

.lang-menu small {
  display: block;
  opacity: 0.55;
  font-size: 0.68rem;
}

@media (max-width: 900px) {
  .lang-switch {
    margin-left: auto;
  }

  .lang-switch summary {
    font-size: 0.72rem;
    opacity: 0.62;
  }
}
