/* Шторка знизу на телефоні (T-0305) — packages/ui/sheet.js. Низька — без підкладки, щоб
   над нею було видно сцену; висока — модальна, для меню й переліків. */
.ui-sheet {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  width: 100%; max-width: none; max-height: 48dvh; margin: 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display: none; flex-direction: column;
  border: 1px solid var(--border-gold); border-bottom: 0; border-radius: var(--radius-md, 14px) var(--radius-md, 14px) 0 0;
  background: var(--surface, #fff); color: var(--text);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, .14);
  overscroll-behavior: contain;
  transition: transform 220ms cubic-bezier(.32, .72, 0, 1);
}
.ui-sheet[open] { display: flex; animation: ui-sheet-in 260ms cubic-bezier(.32, .72, 0, 1); }
.ui-sheet-tall { max-height: 85dvh; }
.ui-sheet:focus { outline: none; }
.ui-sheet::backdrop { background: rgba(0, 0, 0, .28); }
@keyframes ui-sheet-in { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .ui-sheet[open] { animation: none; }
  .ui-sheet { transition: none; }
}
/* Ручка й шапка — місце, за яке тягнуть вниз. */
.ui-sheet-grip { flex: none; width: 40px; height: 5px; margin: 8px auto 2px; border-radius: 3px; background: var(--border-gold); touch-action: none; }
.ui-sheet-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; touch-action: none; }
.ui-sheet-head h2 { flex: 1 1 auto; margin: 0; font-size: 1.05rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-sheet-x { flex: none; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--hint); cursor: pointer; touch-action: manipulation; }
.ui-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Поля у шторці — під палець і без зуму iOS (шрифт ≥ 16 px). */
.ui-sheet-body input, .ui-sheet-body select, .ui-sheet-body textarea { font-size: 16px; min-height: 44px; }
.ui-sheet-body button { touch-action: manipulation; }
/* Низ шторки з діями (I-0251 S9a, docs: аркуш тома): лежить останнім у .ui-sheet-body
   і липне до низу, поки гортається перелік над ним. */
.ui-sheet-foot { position: sticky; bottom: 0; display: flex; gap: var(--gap-touch);
  margin-top: var(--space-5); padding-block: var(--space-5) var(--space-2);
  border-top: 1px solid var(--border-gold); background: var(--surface); }
.ui-sheet-foot > .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
