/* ==========================================================================
   TOAST, the kit's own surface (<verser-toast-region class="verser-toast">), used when the page mounts no toast element
   of its own. It looks and moves exactly like the app's #toast (index.html .toast): a small glass box at the top,
   inline-end side, just under the title row (or under --toast-head when the page sets it), that fits its words up to
   280px, slides in from the inline end and leaves the same way, a little faster than it came.
   data-state: open | closing; data-tone: default | success | danger.
   ========================================================================== */
.verser-toast{
  position:fixed;inset-block-start:max(var(--verser-toast-inset-block-start,calc(max(12px,env(safe-area-inset-top,0px)) + 68px)),var(--toast-head,0px));
  inset-block-end:auto;inset-inline-start:auto;inset-inline-end:var(--edge-right,var(--verser-toast-inset-inline-end,12px));
  z-index:var(--verser-toast-z-index,72);display:block;visibility:hidden;opacity:0;translate:calc(100% + 24px) 0;
  box-sizing:border-box;inline-size:max-content;
  max-inline-size:min(var(--verser-toast-max-inline-size,280px),calc(100vw - var(--verser-toast-gutter,24px)));
  padding-block:var(--verser-toast-padding-block,11px);
  padding-inline:var(--verser-toast-padding-inline-start,14px) var(--verser-toast-padding-inline-end,40px);
  border:1px solid var(--verser-toast-border,var(--vx-hair));border-radius:var(--verser-toast-radius,var(--radius-sm));
  background:var(--verser-toast-gloss,var(--surface-gloss)),var(--verser-toast-fill,var(--vx-overlay));background-origin:border-box;
  -webkit-backdrop-filter:var(--verser-toast-blur,var(--blur));backdrop-filter:var(--verser-toast-blur,var(--blur));
  box-shadow:var(--verser-toast-shadow,var(--vx-shadow));color:var(--verser-toast-text,var(--text));
  font-family:var(--font-ui);font-size:var(--verser-toast-font-size,14px);line-height:var(--verser-toast-line-height,1.45);
  text-align:start;overflow-wrap:anywhere;pointer-events:none;
  transition:opacity var(--verser-toast-exit-duration,180ms) ease,translate var(--verser-toast-exit-slide-duration,200ms) var(--ease-out),
    visibility 0s linear var(--verser-toast-exit-slide-duration,200ms)
}
.verser-toast:dir(rtl){translate:calc(-100% - 24px) 0}
.verser-toast[data-state=open]{visibility:visible;opacity:1;translate:none;
  transition:opacity var(--verser-toast-duration,220ms) var(--ease-out),translate var(--verser-toast-slide-duration,280ms) var(--ease-out),visibility 0s}
.verser-toast[data-tone=danger]{border-color:color-mix(in srgb,var(--danger) 40%,transparent)}
.verser-toast[data-tone=success]{border-color:color-mix(in srgb,var(--success) 35%,transparent)}
/* Taps on the words pass through to what is under them; only the buttons take taps, and none once it is leaving. */
.verser-toast-action,.verser-toast-close{pointer-events:auto}
.verser-toast:not([data-state=open]) :is(.verser-toast-action,.verser-toast-close){pointer-events:none}
.verser-toast-action{min-block-size:var(--tap-min,44px);margin-inline-start:var(--space-2);padding-block:4px;padding-inline:12px;border:0;
  border-radius:var(--radius-pill);background:var(--verser-toast-action-fill,var(--text));color:var(--verser-toast-action-text,var(--vx-floor));
  font:inherit;font-weight:600;cursor:pointer}
/* The close button: a 44px tap target in the box's top inline-end corner, drawn as a small x. */
.verser-toast-close{position:absolute;inset-block-start:0;inset-inline-end:0;display:grid;place-items:center;inline-size:44px;block-size:44px;
  padding:0;border:0;background:none;color:var(--verser-toast-close,var(--text-secondary));cursor:pointer}
.verser-toast-close svg{inline-size:12px;block-size:12px;stroke:currentColor;stroke-width:2;stroke-linecap:round;fill:none}
.verser-toast :focus-visible{outline:var(--focus-ring-width,2px) solid var(--focus-ring);outline-offset:var(--focus-ring-offset,2px)}
/* Reduced motion: no slide, a fade only. */
@media (prefers-reduced-motion:reduce){.verser-toast,.verser-toast:dir(rtl){translate:none}}
