/* Keep painted controls and hit targets in the same, untransformed layout.
   A filled transform animation otherwise leaves main/dialog composited even
   when its final transform looks like "none". */
@media screen {
 body main.page-enter { animation:yummy-page-fade .18s ease-out backwards; transform:none; }
 body .candy-dialog[open] { animation:yummy-page-fade .18s ease-out backwards; transform:none; }
 body .candy-dialog.leaving { animation:yummy-dialog-fade-out .15s ease-in forwards; }
 @keyframes yummy-page-fade { from { opacity:0; } to { opacity:1; } }
 @keyframes yummy-dialog-fade-out { to { opacity:0; } }

 body .transaction-card .transaction-open, body button.ledger-invoice {
  position:relative; min-height:44px; touch-action:manipulation;
 }
 body .transaction-open > *, body button.ledger-invoice > * { pointer-events:none; }
 body #store-dialog #dialog-close {
  display:grid; place-items:center; z-index:3;
  width:44px; height:44px; min-width:44px; min-height:44px;
  padding:0; line-height:1; touch-action:manipulation; cursor:pointer;
 }
 /* The invoice scrolls in its own row; the close control never scrolls away
    or overlaps the receipt. The native dialog still owns focus and Escape. */
 body #store-dialog[open]:has(#live-order) {
  display:grid; grid-template-rows:44px minmax(0,1fr); gap:8px;
  overflow:hidden;
 }
 body #store-dialog:has(#live-order) #dialog-close {
  position:static; grid-row:1; justify-self:end; margin:0;
 }
 body #store-dialog:has(#live-order) #dialog-content {
  grid-row:2; min-height:0; padding-top:0;
  overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin;
 }
 @media (prefers-reduced-motion:reduce) {
  body main.page-enter, body .candy-dialog[open], body .candy-dialog.leaving { animation:none; }
 }
}
