.theme-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.theme-footer .theme-toggle { margin-left: auto; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 58px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--theme-brand);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:focus-visible { outline: 2px solid var(--theme-brand); outline-offset: 6px; }
.theme-toggle__track {
  box-sizing: border-box;
  display: block;
  width: 40px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: #c6cbd4;
  box-shadow: inset 0 1px 3px #18233a26, 0 1px 0 #ffffff80;
  transition: background 180ms ease-out;
}
.theme-toggle__thumb {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(#fff, #f1f3f7);
  box-shadow: 0 1px 3px #10152240, 0 0 0 .5px #1015220d;
  transition: transform 180ms ease-out;
}
.theme-toggle[aria-checked="true"] .theme-toggle__track { background: #3868e8; }
.theme-toggle[aria-checked="true"] .theme-toggle__thumb { transform: translateX(16px); }

/* Crossfade only the background, leaving the orbit live and unsnapshotted.
   Keep the stacking context permanent so changing themes cannot reorient it. */
body { isolation: isolate; }
.team-standalone .team-page { background: transparent; }
.theme-fade {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  animation: theme-background-fade 350ms ease-in-out both;
}
@keyframes theme-background-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle__track, .theme-toggle__thumb { transition: none; }
  .theme-fade { animation: none; }
}
