.toast-region {
  position: fixed; inset: auto max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) auto;
  width: min(380px,calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0;
  border: 0; background: transparent; overflow: auto; color: var(--ui-text,#172235);
  z-index: 10; pointer-events: none;
}
.toast-region:popover-open { display: flex; }
.toast-region::backdrop { background: transparent; pointer-events: none; }
.toast {
  display: grid; grid-template-columns: 22px minmax(0,1fr) 30px; gap: 10px; align-items: center;
  flex: none; padding: 15px 12px 15px 17px; background: var(--ui-surface,#fff); border: 1px solid var(--ui-border,#e3e8f0);
  border-radius: var(--ui-radius-control,8px); box-shadow: 0 8px 28px #15254212;
  color: var(--ui-text,#172235); pointer-events: auto; animation: toast-enter 240ms cubic-bezier(.22,.78,.24,1) both;
}
.toast p { font: 500 13px/1.5 var(--ui-font,system-ui,sans-serif); margin: 0; overflow-wrap: anywhere; max-height: 40dvh; overflow: auto; }
.toast > .ph { font-size: 1.3rem; color: var(--ui-success,#167348); }
.toast-error > .ph { color: var(--ui-danger,#b42332); }
.toast-info > .ph { color: var(--ui-primary,#2563eb); }
.toast-info-mark { width: 19px; height: 19px; border: 1.5px solid var(--ui-primary,#2563eb); color: var(--ui-primary,#2563eb); border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 Georgia,serif; }
.toast .toast-close { border: 0; border-radius: 6px; min-width: 30px; min-height: 30px; padding: 4px; color: var(--ui-muted,#576579); background: transparent; }
.toast .toast-close:hover { background: var(--ui-soft,#f0f3f8); color: var(--ui-text,#172235); }
.toast .toast-close .ph { font-size: .95rem; }
.toast.toast-leaving { animation: toast-leave 180ms cubic-bezier(.22,.78,.24,1) both; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-leave { to { opacity: 0; transform: translateX(15px); } }
@media(max-width: 570px) {
  .toast-region { right: max(16px,env(safe-area-inset-right)); bottom: max(16px,env(safe-area-inset-bottom)); max-height: calc(100dvh - 100px); }
  body:has(.composer-actions) .toast-region { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { padding: 13px 10px 13px 14px; gap: 8px; }
  .toast p { font-size: 13px; }
  .toast .toast-close { min-height: 36px; min-width: 30px; }
}
@media(prefers-reduced-motion: reduce) { .toast,.toast.toast-leaving { animation: none; } }
