@layer components {
  .sheet {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    --sheet-size-sm: calc(100dvh - 92px);
    --sheet-size-md: calc(100dvh - 92px);
    --sheet-size-lg: 375px;
  }
  .sheet[data-state=closed] {
    visibility: hidden;
    transition: visibility 0s 0.3s;
  }
  @media (prefers-reduced-motion: reduce) {
    .sheet[data-state=closed] {
      transition: none;
    }
  }
  .sheet[data-state=open] {
    pointer-events: auto;
  }
  .sheet__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.54);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .sheet[data-state=open] .sheet__backdrop {
    opacity: 1;
  }
  @media (prefers-reduced-motion: reduce) {
    .sheet__backdrop {
      transition: none;
    }
  }
  .sheet__panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    background-color: var(--theme-surface-secondary);
    box-shadow: 0px 16px 16px 0px rgba(29, 33, 48, 0.1), 0px 10px 10px 0px rgba(29, 33, 48, 0.08), 0px 6px 6px 0px rgba(29, 33, 48, 0.06), 0px 3px 3px 0px rgba(29, 33, 48, 0.04), 0px 1px 1px 0px rgba(29, 33, 48, 0.02);
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  @media (prefers-reduced-motion: reduce) {
    .sheet__panel {
      transition: none;
    }
  }
  .sheet[data-direction-sm=bottom] .sheet__panel {
    inset: auto 0 0;
    width: 100%;
    height: var(--sheet-size-sm);
    border-radius: 1rem 1rem 0 0;
    transform: translateY(100%);
  }
  .sheet[data-direction-sm=bottom][data-size-sm=full] .sheet__panel {
    border-radius: 0;
  }
  .sheet[data-direction-sm=right] .sheet__panel {
    inset: 0 0 0 auto;
    width: var(--sheet-size-sm);
    height: 100%;
    transform: translateX(100%);
  }
  .sheet[data-direction-sm=left] .sheet__panel {
    inset: 0 auto 0 0;
    width: var(--sheet-size-sm);
    height: 100%;
    transform: translateX(-100%);
  }
  @media (min-width: 768px) {
    .sheet[data-direction-md=bottom] .sheet__panel {
      inset: auto 0 0;
      width: 100%;
      height: var(--sheet-size-md);
      border-radius: 1rem 1rem 0 0;
      transform: translateY(100%);
    }
    .sheet[data-direction-md=bottom][data-size-md=full] .sheet__panel {
      border-radius: 0;
    }
    .sheet[data-direction-md=right] .sheet__panel {
      inset: 0 0 0 auto;
      width: var(--sheet-size-md);
      height: 100%;
      border-radius: 0;
      transform: translateX(100%);
    }
    .sheet[data-direction-md=left] .sheet__panel {
      inset: 0 auto 0 0;
      width: var(--sheet-size-md);
      height: 100%;
      border-radius: 0;
      transform: translateX(-100%);
    }
  }
  @media (min-width: 1024px) {
    .sheet[data-direction-lg=bottom] .sheet__panel {
      inset: auto 0 0;
      width: 100%;
      height: var(--sheet-size-lg);
      border-radius: 1rem 1rem 0 0;
      transform: translateY(100%);
    }
    .sheet[data-direction-lg=bottom][data-size-lg=full] .sheet__panel {
      border-radius: 0;
    }
    .sheet[data-direction-lg=right] .sheet__panel {
      inset: 0 0 0 auto;
      width: var(--sheet-size-lg);
      height: 100%;
      border-radius: 0;
      transform: translateX(100%);
    }
    .sheet[data-direction-lg=left] .sheet__panel {
      inset: 0 auto 0 0;
      width: var(--sheet-size-lg);
      height: 100%;
      border-radius: 0;
      transform: translateX(-100%);
    }
  }
  .sheet[data-state=open] .sheet__panel {
    transform: translate(0, 0);
  }
  .sheet__drag-handle {
    flex-shrink: 0;
    align-self: center;
    width: 2.5rem;
    height: 0.25rem;
    margin-block: 0.75rem;
    border-radius: 0.25rem;
    background-color: var(--theme-border-secondary);
    display: none;
    cursor: grab;
    touch-action: none;
  }
  .sheet__drag-handle:active {
    cursor: grabbing;
  }
  .sheet[data-direction-sm=bottom] .sheet__drag-handle {
    display: block;
  }
  @media (min-width: 768px) {
    .sheet[data-direction-md=right] .sheet__drag-handle, .sheet[data-direction-md=left] .sheet__drag-handle {
      display: none;
    }
    .sheet[data-direction-md=bottom] .sheet__drag-handle {
      display: block;
    }
  }
  @media (min-width: 1024px) {
    .sheet[data-direction-lg=right] .sheet__drag-handle, .sheet[data-direction-lg=left] .sheet__drag-handle {
      display: none;
    }
    .sheet[data-direction-lg=bottom] .sheet__drag-handle {
      display: block;
    }
  }
  .sheet__header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
  }
  .sheet__title {
    flex: 1;
    margin: 0;
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
  }
  .sheet__back-btn, .sheet__close-btn {
    flex-shrink: 0;
  }
  .sheet__content {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
  }
  .sheet__footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
  }
}