/*! sheet-drag.css 1.0.0 | DJ2000-UK/app-workbench */
/* The grabber (sheets/sheet-drag.js): the small pill at the top of a sheet that a
   finger can drag down to dismiss, as on an iPhone. It shows only while the
   sheet is marked data-sheet-drag, which sheet-drag.js sets only where the drag
   works, so a grabber never shows on a sheet that cannot be dragged (DJ,
   2026-11-30). iOS's own: 36 by 5 px, 5 px from the top, centred.

   It sits in the sheet's top corner band, out of the flow, so it never moves what
   the sheet holds. A sheet that scrolls as a whole (rather than an inner body)
   keeps 24 px free at its top while it is marked, or sets --sheet-grabber-top.
   Its colour is the app's ink at 30%, which every app's palettes define. */

.sheet-grabber { display: none; }

[data-sheet-drag] > .sheet-grabber {
  position: absolute;
  z-index: 6;
  top: var(--sheet-grabber-top, 6px);
  left: 50%;
  display: block;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink, currentColor) 30%, transparent);
  pointer-events: none;
}

/* On its way off the screen it takes no more touches. */
[data-sheet-dragging="out"] { pointer-events: none; }

/* A <dialog> sheet's own backdrop fades as the sheet goes down, where the browser
   lets ::backdrop read the dialog's custom properties (Safari 17.4, Chrome 122).
   A sheet with a backdrop element of its own passes it to attach() instead. */
[data-sheet-drag]::backdrop { opacity: calc(1 - var(--sheet-drag-fade, 0)); }
