.sfm-language {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d2e0e9;
  border-radius: 8px;
  background: #fff;
  color: #123a63;
  line-height: 1;
  font: 700 13px/1.2 Arial, sans-serif;
  white-space: nowrap;
}
.sfm-language > a {
  display: inline-block;
  padding: 8px 7px;
  border-radius: 5px;
  color: #123a63;
  text-decoration: none;
}
.sfm-language > a[aria-current="true"] {
  background: #e5f1f8;
  color: #0a4972;
}
.sfm-language > a:hover { background: #edf5fa; }
.sfm-language > a:focus-visible { outline: 2px solid #0877bd; outline-offset: 1px; }
.sfm-legal-navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.sfm-original-language { display: block; margin-top: .4rem; font-size: .82rem; }
body:has(> header.top) > header.top nav:has(.sfm-language) { column-gap: clamp(8px, 1.25vw, 18px); }
body:has(> header.top) > header.top nav:has(.sfm-language) .navlinks { column-gap: clamp(10px, 1.12vw, 18px); }
@media (max-width: 520px) {
  .sfm-language { font-size: 12px; padding: 2px; }
  .sfm-language > a { padding: 8px 5px; }
  header.top nav:has(.sfm-language) .phone { font-size: 12px; }
}
body:has(> header.top) > header.top nav:has(.sfm-language) .navlinks {
  flex-wrap: wrap;
  row-gap: 4px;
}
header.top > .wrap:has(.sfm-language) {
  flex-wrap: wrap;
  column-gap: 10px;
  row-gap: 7px;
}
@media (max-width: 520px) {
  header.top nav:has(.sfm-language) .logo { width: clamp(96px, 32vw, 145px); }
  header.top nav:has(.sfm-language) .topcontact .btn { padding: 8px 9px; font-size: 12px; }
}
@media (max-width: 430px) {
  header.top nav:has(.sfm-language) > .phone { display: none; }
}

/* The language labels remain visible. The flags are decorative. */
.sfm-language > a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sfm-language > a::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 18px;
  border-radius: 1px;
  background: center / 100% 100% no-repeat;
  box-shadow: 0 0 0 1px #9995;
}
.sfm-language > a[hreflang="de"]::after {
  aspect-ratio: 5 / 3;
  background-image: url("/language-de.png");
}
.sfm-language > a[hreflang="en"]::after {
  aspect-ratio: 2 / 1;
  background-image: url("/language-en.png");
}
@media (max-width: 520px) {
  .sfm-language > a { gap: 4px; padding-inline: 5px; }
  .sfm-language > a::after { width: 15px; }
}

@media (max-width: 430px) {
  header.top nav:has(> .topcontact):has(> .sfm-language) .logo { width: clamp(88px, 25vw, 105px); }
}
@media (max-width: 365px) {
  header.top nav:has(> .topcontact):has(> .sfm-language) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo language" "contact contact";
    height: auto;
    min-height: 64px;
    row-gap: 5px;
    padding-block: 7px;
  }
  header.top nav:has(> .topcontact):has(> .sfm-language) > .logo { grid-area: logo; }
  header.top nav:has(> .topcontact):has(> .sfm-language) > .sfm-language { grid-area: language; }
  header.top nav:has(> .topcontact):has(> .sfm-language) > .topcontact {
    grid-area: contact;
    margin-inline: 0;
  }
}
