/* Shared native dialog motion. Pointer capture is limited to the grabber. */
#sheet.ballr-motion-sheet {
  --sheet-scrim-strength: 1;
  /* A translating absolute dialog increases the document's scrollable area.
     Keep native focus restoration and repeated opens anchored to the viewport. */
  position: fixed;
  transform-origin: center bottom;
  isolation: isolate;
}

#sheet.ballr-motion-sheet::backdrop {
  background: rgb(0 0 0 / calc(.4 * var(--sheet-scrim-strength)));
  backdrop-filter: blur(calc(4px * var(--sheet-scrim-strength)));
  -webkit-backdrop-filter: blur(calc(4px * var(--sheet-scrim-strength)));
}

#sheet.ballr-motion-sheet.sheet-is-opening::backdrop {
  animation: ballr-sheet-scrim-in 240ms ease-out both;
}

#sheet.ballr-motion-sheet.sheet-is-closing::backdrop {
  animation: ballr-sheet-scrim-out 180ms ease-in both;
}

#sheet.ballr-motion-sheet .sheet-grabber {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--screen-bg, #fff);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

#sheet.ballr-motion-sheet .sheet-grabber span {
  display: block;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: #d2d2d7;
}

#sheet.ballr-motion-sheet.sheet-is-dragging .sheet-grabber {
  cursor: grabbing;
}

#sheet.ballr-motion-sheet .sheet-head {
  top: 28px;
  padding-top: 6px;
}

#sheet.ballr-motion-sheet.sheet-is-opening,
#sheet.ballr-motion-sheet.sheet-is-closing,
#sheet.ballr-motion-sheet.sheet-is-dragging {
  will-change: transform;
}

@keyframes ballr-sheet-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ballr-sheet-scrim-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #sheet.ballr-motion-sheet::backdrop {
    animation: none !important;
  }
}
