/* Load after the site's header CSS. No JS => no layout changes. */
html { --wwfh-css-ready: 1; }
html[data-wwfh-root="active"] {
  scroll-padding-top: max(var(--wwfh-native-scroll-padding, 0px), var(--wwfh-occlusion, 0px)) !important;
}

[data-wwfh-state="following"] {
  position: fixed !important;
  inset: auto !important;
  top: max(5px, env(safe-area-inset-top, 0px)) !important;
  left: var(--wwfh-left) !important;
  width: var(--wwfh-width) !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: var(--wwfh-follow-min-height, var(--wwfh-min-height)) !important;
  max-height: none !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding-top: var(--wwfh-follow-padding-top, var(--wwfh-native-padding-top)) !important;
  padding-right: var(--wwfh-native-padding-right) !important;
  padding-bottom: var(--wwfh-follow-padding-bottom, var(--wwfh-native-padding-bottom)) !important;
  padding-left: var(--wwfh-native-padding-left) !important;
  border-top: var(--wwfh-native-border-top) !important;
  border-right: var(--wwfh-native-border-right) !important;
  border-bottom: var(--wwfh-native-border-bottom) !important;
  border-left: var(--wwfh-native-border-left) !important;
  background: var(--wwfh-native-background) !important;
  color: var(--wwfh-native-color) !important;
  overflow: visible !important;
  display: var(--wwfh-native-display) !important;
  transform: none !important;
  translate: none !important;
  rotate: none !important;
  scale: none !important;
  transition: none !important;
  animation: none !important;
  z-index: var(--wwfh-native-z-index, auto) !important;
  /* Deliberately no font, logo, grid, gap or control-size overrides. */
}

[data-wwfh-state="following"]::backdrop {
  background: transparent;
  pointer-events: none;
}

[data-wwfh-state="following"] [data-wwfh-surface] {
  background: #fff;
  border-radius: var(--wwfh-radius, 100px);
  box-shadow: 0 10px 20px rgba(71, 96, 156, .2);
  /* No clipping: dropdowns and focus rings may extend beyond the pill. */
}

@media (prefers-reduced-motion: reduce) {
  [data-wwfh-state="following"] { scroll-behavior: auto; }
}
