body {
  font-family: system-ui, sans-serif;
  margin: 0;
}

.scroller {
  height: 300px;
  overflow-y: auto;
  margin: 2rem;
  border: 1px solid #ddd;
}

main {
  padding: 0 1rem;
}

.sticky-head {
  position: sticky;
  top: 0;
  padding: 1rem;
  background: #fff;
  transition: box-shadow 0.3s ease, background 0.3s ease;

  /* container-type: scroll-state statt size — reagiert auf den Scroll-
     Zustand, nicht auf die eigene Größe. Braucht keinen container-name
     hier, weil nur ein Scroll-State-Container in diesem Demo existiert. */
  container-type: scroll-state;
}

/* Ohne Support (Firefox/Safari, Stand 2026-07-28, ~68% global, Chrome/Edge
   133+): Header bleibt normal sticky, nur der Schatten-Trigger fehlt —
   reine Enhancement, kein Fallback-CSS nötig. */
@container scroll-state(stuck: top) {
  .sticky-head {
    background: #f5f5f5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  }
}
