/*
 * Shared overlay chrome — Bottom Sheet / Edge Panel.
 * Layout height stays tight; 44px hit expands inward via ::after (no extra row).
 */

.sheet-handle {
  position: relative;
  z-index: 3;
  display: grid;
  width: 100%;
  height: var(--sheet-handle-height, 1rem);
  flex: 0 0 var(--sheet-handle-height, 1rem);
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  color: inherit;
}

.sheet-handle::before {
  position: relative;
  z-index: 1;
  display: block;
  width: var(--sheet-handle-line-width, 2.25rem);
  height: var(--sheet-handle-line-height, .2rem);
  border-radius: 999px;
  background: var(--lu4-border-strong, var(--border-strong));
  content: "";
  transition: background .12s ease, transform .12s ease;
}

/* Hit target ≥44px, painted inward over panel content — does not add layout height. */
.sheet-handle::after {
  position: absolute;
  right: 0;
  left: 0;
  height: var(--lu4-touch-target, 2.75rem);
  content: "";
}

.sheet-handle--top::after { top: 0; } /* expand downward into the card */
.sheet-handle--bottom::after { bottom: 0; } /* expand upward into the panel */

.sheet-handle:hover::before,
.sheet-handle:active::before {
  background: var(--lu4-text-muted, var(--text-muted));
}

/* 通用按钮焦点框会被折叠容器裁成横线；把键盘焦点收束到可见短横上。 */
.sheet-handle:focus,
.sheet-handle:focus-visible {
  outline: 0;
}

.sheet-handle:focus-visible::before {
  background: var(--lu4-text-muted, var(--text-muted));
  box-shadow: 0 0 0 2px var(--lu4-focus-ring, var(--focus));
}

.sheet-surface {
  --sheet-offset: 0px;
}

.sheet-surface.is-sheet-dragging {
  transition: none !important;
  user-select: none;
}

.sheet-surface.is-sheet-instant,
.sheet-surface.is-sheet-animating {
  transition: none !important;
}

.sheet-surface.is-sheet-dragging .sheet-handle {
  cursor: grabbing;
}

@media (prefers-reduced-motion: reduce) {
  .sheet-handle::before,
  .sheet-surface {
    transition: none !important;
  }
}
