:root {
  --ps-toast-surface: color-mix(in srgb, var(--glass-bg-strong, #ffffff) 94%, transparent);
  --ps-toast-text: var(--text-main, #172033);
  --ps-toast-muted: var(--text-soft, #5f6b7a);
  --ps-toast-border: var(--glass-border, rgba(15, 23, 42, .16));
  --ps-toast-success: #0f9f75;
  --ps-toast-error: #d84b62;
  --ps-toast-warning: #b77909;
  --ps-toast-info: #1686b8;
}

html[data-theme="dark"] {
  --ps-toast-surface: rgba(15, 23, 42, .96);
  --ps-toast-text: #f8fafc;
  --ps-toast-muted: #cbd5e1;
  --ps-toast-border: rgba(148, 163, 184, .24);
}

html[data-theme="liquid"] {
  --ps-toast-surface: rgba(9, 24, 43, .90);
  --ps-toast-text: #f8fbff;
  --ps-toast-muted: #d7e3f1;
  --ps-toast-border: rgba(255, 255, 255, .26);
}

html[data-theme="clean"],
html[data-theme="day"] {
  --ps-toast-surface: rgba(255, 255, 255, .98);
  --ps-toast-text: #172033;
  --ps-toast-muted: #526274;
  --ps-toast-border: rgba(15, 23, 42, .15);
}

.psfacil-toast-region {
  position: fixed;
  z-index: 2147483000;
  top: calc(env(safe-area-inset-top, 0px) + 108px);
  right: 18px;
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.psfacil-toast {
  --ps-toast-accent: var(--ps-toast-info);
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 13px 12px 13px 13px;
  overflow: hidden;
  color: var(--ps-toast-text);
  background: var(--ps-toast-surface);
  border: 1px solid color-mix(in srgb, var(--ps-toast-accent) 34%, var(--ps-toast-border));
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(2, 8, 23, .20);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  pointer-events: auto;
  isolation: isolate;
  animation: psToastIn .24s cubic-bezier(.22, .8, .3, 1) both;
}

.psfacil-toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--ps-toast-accent);
}

.psfacil-toast[data-type="success"] { --ps-toast-accent: var(--ps-toast-success); }
.psfacil-toast[data-type="error"] { --ps-toast-accent: var(--ps-toast-error); }
.psfacil-toast[data-type="warning"] { --ps-toast-accent: var(--ps-toast-warning); }
.psfacil-toast[data-type="info"] { --ps-toast-accent: var(--ps-toast-info); }

.psfacil-toast.is-leaving {
  animation: psToastOut .20s ease both;
}

.psfacil-toast__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--ps-toast-accent);
  background: color-mix(in srgb, var(--ps-toast-accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--ps-toast-accent) 22%, transparent);
  font-size: 1.05rem;
}

.psfacil-toast__content {
  min-width: 0;
  padding-top: 1px;
}

.psfacil-toast__title {
  margin: 0 0 2px;
  color: var(--ps-toast-text);
  font-size: .84rem;
  font-weight: 900;
  line-height: 1.25;
}

.psfacil-toast__message {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ps-toast-muted);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.45;
}

.psfacil-toast__close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ps-toast-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font: 700 1.2rem/1 system-ui, sans-serif;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.psfacil-toast__close:hover {
  color: var(--ps-toast-text);
  background: color-mix(in srgb, var(--ps-toast-text) 7%, transparent);
  border-color: var(--ps-toast-border);
}

.psfacil-toast__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ps-toast-accent) 34%, transparent);
  outline-offset: 1px;
}

@keyframes psToastIn {
  from { opacity: 0; transform: translate3d(14px, -7px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes psToastOut {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(10px, -5px, 0) scale(.985); }
}

@media (max-width: 767.98px) {
  .psfacil-toast-region {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    left: 12px;
    width: auto;
  }

  .psfacil-toast {
    grid-template-columns: 36px minmax(0, 1fr) 32px;
    gap: 9px;
    padding: 11px;
    border-radius: 14px;
  }

  .psfacil-toast__icon { width: 36px; height: 36px; }
  .psfacil-toast__close { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .psfacil-toast,
  .psfacil-toast.is-leaving {
    animation-duration: .01ms;
  }

  .psfacil-toast__close { transition: none; }
}
