/* fix 143 (app/f143.php, design/language.md "Pop-ups"): one way for every pop-up to open and close. Loaded after assets/fix7/system.css
   and assets/fix129/f129.css while fix143 is on.
   - Opens from scale .97 and opacity 0, 6 px toward the button that opened it, grown out of that button (assets/src/f143/f143.ts sets
     the origin): 200 ms for a small one, 260 ms for a large one, on a curve that is fast at first and lands softly.
   - Closes faster than it opens, back the same way: 140 ms small, 170 ms large, on a curve that leaves quickly.
   - The shade behind it (the dim, the scrim, the wash, a dialog's backdrop) fades on the same clock.
   - Transform and opacity only. Under reduced motion none of this applies: the old rules (transition: none) stand, and everything
     appears and goes at once. */
:root{--f143-in-s:.2s;--f143-in-l:.26s;--f143-out-s:.14s;--f143-out-l:.17s;--f143-open:cubic-bezier(.16,1,.3,1);--f143-close:cubic-bezier(.4,0,1,1)}

@media (prefers-reduced-motion:no-preference){
  /* small: the header's pop-ups (Have a code?, the bell, the account menu) and the footer's language list */
  html:root body .bf-pop.f7-pop{transform-origin:var(--f143-o,50% 0);transform:translateY(var(--f143-dy,-6px)) scale(.97);
    transition:opacity var(--f143-out-s) var(--f143-close),transform var(--f143-out-s) var(--f143-close)}
  html:root body .bf-pop.f7-pop.is-open{transform:none;transition:opacity var(--f143-in-s) var(--f143-open),transform var(--f143-in-s) var(--f143-open)}

  /* large: the phone's menu, out of the burger */
  html:root body .bf-pop.f7-drawer{transform-origin:var(--f143-o,100% 0);transform:translateY(-6px) scale(.97);
    transition:opacity var(--f143-out-l) var(--f143-close),transform var(--f143-out-l) var(--f143-close)}
  html:root body .bf-pop.f7-drawer.is-open{transform:none;transition:opacity var(--f143-in-l) var(--f143-open),transform var(--f143-in-l) var(--f143-open)}

  /* large: a sheet, from its own edge (the right on a computer, the bottom on a phone) */
  .bf-sheet{transition:opacity var(--f143-out-l) var(--f143-close),transform var(--f143-out-l) var(--f143-close)}
  .bf-sheet.is-open{transition:opacity var(--f143-in-l) var(--f143-open),transform var(--f143-in-l) var(--f143-open)}

  /* the shades behind them */
  .f7-dim,.f7-scrim,.f7-wash{transition:opacity var(--f143-out-l) var(--f143-close)}
  .f7-dim.is-open,.f7-scrim.is-open,.f7-wash.is-open{transition:opacity var(--f143-in-l) var(--f143-open)}

  /* small: the toast */
  .f7-toast{transition:opacity var(--f143-out-s) var(--f143-close),transform var(--f143-out-s) var(--f143-close)}
  .f7-toast.is-on{transition:opacity var(--f143-in-s) var(--f143-open),transform var(--f143-in-s) var(--f143-open)}

  /* large: Ask Bonfium's window, out of its button at the bottom right; it used to vanish at once, now it goes back the same way */
  html.f63 body .f63-ask-w{animation:none;transform-origin:100% 100%;opacity:1;transform:none;
    transition:opacity var(--f143-in-l) var(--f143-open),transform var(--f143-in-l) var(--f143-open),display var(--f143-in-l) allow-discrete}
  html.f63 body .f63-ask-w[hidden]{display:none;opacity:0;transform:translateY(8px) scale(.97);
    transition:opacity var(--f143-out-l) var(--f143-close),transform var(--f143-out-l) var(--f143-close),display var(--f143-out-l) allow-discrete}
  @starting-style{html.f63 body .f63-ask-w:not([hidden]){opacity:0;transform:translateY(8px) scale(.97)}}

  /* large: every dialog (the ticket, a trade's cancel and withdraw), from the middle; it used to appear and vanish at once */
  html body dialog{opacity:0;transform:translateY(8px) scale(.97);
    transition:opacity .17s cubic-bezier(.4,0,1,1),transform .17s cubic-bezier(.4,0,1,1),overlay .17s allow-discrete,display .17s allow-discrete}
  html body dialog[open]{opacity:1;transform:none;
    transition:opacity .26s cubic-bezier(.16,1,.3,1),transform .26s cubic-bezier(.16,1,.3,1),overlay .26s allow-discrete,display .26s allow-discrete}
  @starting-style{html body dialog[open]{opacity:0;transform:translateY(8px) scale(.97)}}
  html body dialog::backdrop{opacity:0;transition:opacity .17s cubic-bezier(.4,0,1,1),overlay .17s allow-discrete,display .17s allow-discrete}
  html body dialog[open]::backdrop{opacity:1;transition:opacity .26s cubic-bezier(.16,1,.3,1),overlay .26s allow-discrete,display .26s allow-discrete}
  @starting-style{html body dialog[open]::backdrop{opacity:0}}
  html body .v3 dialog.v3-dialog[open] .sheet{animation:none}   /* the dialog itself opens now; its sheet no longer opens a second time */
}
