/* Шторка снизу (как в iOS) на телефоне, окно по центру на широком экране (от 768px). Логика — в sheet.js. */
.sheet { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet__backdrop {
  position: absolute; inset: 0; background: var(--backdrop);
  opacity: 0; transition: opacity .45s var(--ease-ios);
}
.sheet__panel {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 560px;
  max-height: calc(100% - 28px - env(safe-area-inset-top, 0px));
  background: var(--card); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-sheet);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translate3d(0, 100%, 0);
  transition: transform .5s var(--ease-ios);
  will-change: transform; outline: 0;
}
/* «подкладка» под шторкой — чтобы при оттягивании вверх не было просвета */
.sheet__panel::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: inherit; }

.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: translate3d(0, 0, 0); }
.sheet.is-dragging .sheet__panel, .sheet.is-dragging .sheet__backdrop { transition: none; }

.sheet__head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px 10px 20px; touch-action: none;
}
.sheet__title { font: 400 18px/1.3 var(--font-display); letter-spacing: -.01em; }

.sheet__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.sheet__foot { flex: none; display: flex; gap: 8px; padding: 12px 20px 20px; box-shadow: 0 -1px 0 var(--line); }

/* широкий экран: то же содержимое, но окном по центру — без выезда снизу и без жеста */
@media (min-width: 768px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet__panel {
    max-width: 480px; max-height: 100%;
    border-radius: 24px; padding-bottom: 0;
    box-shadow: 0 0 1px rgba(0, 0, 0, .4), 0 12px 48px rgba(0, 0, 0, .18);
    opacity: 0; transform: scale(.96); transform-origin: center center; will-change: auto;
    transition: transform .24s var(--ease-ios), opacity .18s var(--ease); /* растёт из своего центра, без движения вверх */
  }
  .sheet.is-open .sheet__panel { opacity: 1; transform: none; }
  .sheet__panel::after { display: none; }
  .sheet__backdrop { transition-duration: .25s; }
  .sheet__head { padding: 16px 14px 10px 20px; touch-action: auto; }
  .sheet__body { padding: 4px 20px 20px; }
  .sheet__foot { padding: 14px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet__panel, .sheet__backdrop { transition-duration: .01ms; }
}
