/* The site's toast (assets/toast.js): an ink panel at the top of the
   window, the ink key's face from the material tokens in
   assets/material.css, which every page loads through its own stylesheet.

   It drops in from above the window edge with a slight overshoot and
   rises back out when it goes. A new note while one is showing swaps the
   text and gives the panel a short bump instead of replaying the drop. */

.vdt-toast {
  position: fixed;
  /* Clear of the popover's own placement (inset 0, margin auto). */
  inset: max(16px, env(safe-area-inset-top)) auto auto 50%;
  z-index: 70;
  box-sizing: border-box;
  /* Its own text width: left at 50% would otherwise cap it at half the
     window and wrap short notes on a phone. */
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  overflow: visible;
  padding: 8px 24px;
  border: 1px solid var(--ink-key-rim);
  /* A squircle rather than the site's gentler default curve, which reads
     as a plain round corner on a box this short. */
  border-radius: 16px;
  --lumno-corner-shape: squircle;
  background: var(--ink-key-sheen) var(--ink-key-bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), 0 1px 2px rgb(0 0 0 / 0.18), 0 10px 24px -8px rgb(0 0 0 / 0.35);
  color: var(--ink-key-text);
  text-shadow: var(--ink-key-label);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
  /* Hidden: above its place, a little smaller and soft. This is also where
     it leaves to, quicker than it came in. */
  opacity: 0;
  filter: blur(4px);
  transform: translate(-50%, calc(-100% - 16px)) scale(0.94);
  transition:
    opacity 180ms ease-in,
    filter 180ms ease-in,
    transform 240ms cubic-bezier(.4, 0, 1, 1);
}

.vdt-toast[data-show] {
  opacity: 1;
  filter: blur(0);
  transform: translate(-50%, 0) scale(1);
  transition:
    opacity 200ms ease-out,
    filter 260ms ease-out,
    transform 460ms cubic-bezier(.34, 1.4, .64, 1);
}

.vdt-toast-text { display: inline-block; }

.vdt-toast[data-bump] .vdt-toast-text { animation: vdt-toast-bump 320ms cubic-bezier(.34, 1.4, .64, 1); }

.vdt-toast[data-bump] { animation: vdt-toast-pulse 320ms cubic-bezier(.34, 1.4, .64, 1); }

@keyframes vdt-toast-pulse {
  40% { scale: 1.04; }
}

@keyframes vdt-toast-bump {
  from { opacity: 0; translate: 0 4px; }
}

/* For screen readers only. */
.vdt-toast-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Fades only, in place. */
@media (prefers-reduced-motion: reduce) {
  .vdt-toast,
  .vdt-toast[data-show] {
    filter: none;
    transform: translate(-50%, 0);
    transition: opacity 160ms ease;
  }
  .vdt-toast[data-bump],
  .vdt-toast[data-bump] .vdt-toast-text { animation: none; }
}
