.version-switcher {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(8, 17, 29, 0.14);
  border-radius: 8px;
  background: rgba(250, 248, 242, 0.55);
  box-shadow: 0 2px 10px rgba(8, 17, 29, 0.1);
  color: #07111d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0.45;
  transition: opacity 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.version-switcher:hover,
.version-switcher:focus-within,
.version-switcher.is-open {
  opacity: 1;
  background: rgba(250, 248, 242, 0.88);
  box-shadow: 0 10px 34px rgba(8, 17, 29, 0.16);
}

.version-switcher__label {
  display: none;
  margin: 0;
  color: rgba(7, 17, 29, 0.55);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.version-switcher:hover .version-switcher__label,
.version-switcher:focus-within .version-switcher__label,
.version-switcher.is-open .version-switcher__label {
  display: block;
}

.version-switcher__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 3px;
  max-width: min(92vw, 480px);
}

.version-switcher a {
  display: inline-grid;
  min-width: 30px;
  min-height: 24px;
  place-items: center;
  border: 1px solid rgba(7, 17, 29, 0.14);
  border-radius: 5px;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

/* Collapsed: only the current version shows, as a small quiet chip. */
.version-switcher:not(:hover):not(:focus-within):not(.is-open) a:not([aria-current="page"]) {
  display: none;
}

.version-switcher a:hover,
.version-switcher a:focus-visible {
  background: rgba(7, 17, 29, 0.08);
}

.version-switcher a[aria-current="page"] {
  border-color: rgba(7, 17, 29, 0.85);
  color: #f8f5ec;
  background: rgba(7, 17, 29, 0.85);
}

@media (max-width: 640px) {
  .version-switcher {
    right: 10px;
    bottom: 10px;
  }

  .version-switcher a {
    min-width: 28px;
    min-height: 24px;
  }
}
