.mley-toast-region {
  position: fixed; z-index: 2147483000; inset: auto;
  top: max(var(--mley-toast-top, 16px), env(safe-area-inset-top, 0px));
  right: calc(var(--mley-toast-right, 0px) + max(16px, env(safe-area-inset-right, 0px)));
  width: min(420px, calc(var(--mley-toast-width, 100vw) - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: var(--mley-toast-available, calc(100dvh - 32px));
  margin: 0; padding: 0; border: 0; background: transparent; overflow: visible;
  display: grid; gap: 10px; pointer-events: none; font-family: inherit; text-align: left; color: inherit;
}
.mley-toast-region[hidden], .mley-toast-stack[hidden], .mley-toast-history[hidden], [data-mley-notice-ready] { display: none !important; }
.mley-toast-region::backdrop { background: transparent; pointer-events: none; }
.mley-toast {
  --toast-accent: #286780; box-sizing: border-box; display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px; align-items: start; gap: 10px;
  padding: 14px 12px 14px 16px; border: 1px solid var(--border-color, #d6e0e5); border-radius: 18px;
  background: var(--bg-surface, #fff); color: var(--text-color, #233640); box-shadow: 0 8px 32px #13293622, 0 2px 6px #13293610;
  max-height: calc((var(--mley-toast-available, 100dvh) - 64px) / 2);
  overflow: auto; overscroll-behavior: contain;
  pointer-events: auto; font-size: 15px; line-height: 1.5; touch-action: pan-y pinch-zoom;
  transform: translateX(var(--toast-drag-x, 0px)); opacity: var(--toast-drag-opacity, 1);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .22s ease; animation: mley-toast-enter .22s ease-out;
}
.mley-toast.is-dragging { animation: none; transition: none; user-select: none; }
.mley-toast.is-leaving { animation: none; transform: translateX(var(--toast-exit-x, 115%)); opacity: 0; pointer-events: none; }
.mley-toast[data-kind="success"] { --toast-accent: #22735a; }
.mley-toast[data-kind="warning"] { --toast-accent: #966419; }
.mley-toast[data-kind="error"] { --toast-accent: #b54742; }
.mley-toast__icon { color: var(--toast-accent); margin-top: 3px; }
.mley-toast__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mley-toast__message { margin: 3px 0 0; padding: 0; font: inherit; color: inherit; overflow-wrap: anywhere; }
.mley-toast__action, .mley-toast__close { font: inherit; cursor: pointer; border: 0; background: transparent; border-radius: 6px; }
.mley-toast__action { display: inline-flex; align-items: center; min-height: 44px; margin: 5px 0 -3px; padding: 3px 0; color: var(--toast-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mley-toast__action[hidden] { display: none; }
.mley-toast__close { width: 44px; height: 44px; padding: 0; color: inherit; font-size: 22px; line-height: 1; opacity: .7; }
.mley-toast__close:hover { background: var(--bg-surface-2, #f0f4f5); opacity: 1; }
.mley-toast button:focus-visible { outline: 2px solid var(--toast-accent); outline-offset: 3px; }
@keyframes mley-toast-enter { from { opacity: 0; transform: translateY(-12px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.mley-toast-region:has(.mley-toast-history[open]) .mley-toast-stack { display: none; }
.mley-toast-stack { display: grid; gap: 10px; }
.mley-toast-history { justify-self: end; width: 100%; color: var(--text-color); pointer-events: none; font-size: 14px; }
.mley-toast-history__toggle { box-sizing: border-box; width: fit-content; min-height: 44px; margin-left: auto; padding: 10px 14px;
  cursor: pointer; pointer-events: auto; border: 1px solid var(--border-color); border-radius: 12px; background: var(--bg-surface); color: var(--text-color); }
.mley-toast-history__toggle:hover { background: var(--bg-surface-2); }
.mley-toast-history__toggle:focus-visible, .mley-toast-history input:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
.mley-toast-history__panel { box-sizing: border-box; pointer-events: auto; margin-top: 8px; padding: 16px; border-radius: 14px;
  border: 1px solid var(--border-color); background: var(--bg-surface); max-height: calc(var(--mley-toast-available, 100dvh) - 54px);
  overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; line-height: 1.5; }
.mley-toast-history__hint { margin: 0 0 8px; color: var(--text-muted); }
.mley-toast-history__preference { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.mley-toast-history__preference input { flex: none; width: 20px; height: 20px; accent-color: var(--accent-color); }
.mley-toast-history .mley-toast__action { display: flex; color: var(--accent-color); }
.mley-toast-history .mley-toast__action:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
.mley-toast-history .mley-toast__action:disabled { opacity: .6; cursor: default; text-decoration: none; }
.mley-toast-history__list { padding-left: 20px; margin: 12px 0 0; }
.mley-toast-history__item { padding: 10px 0; border-top: 1px solid var(--border-color); }
@media (max-width: 600px) { .mley-toast { font-size: 16px; max-height: calc(var(--mley-toast-available, 100dvh) - 64px); } }
@media (prefers-reduced-motion: reduce) { .mley-toast { animation: none; transition: none; } }
@media print { .mley-toast-region { display: none !important; } }
