.stack {
  --ink: #171c25;
  --muted: #677184;
  --success: #148343;
  position: fixed;
  z-index: 100100;
  top: var(--fa-toast-top, 84px);
  right: var(--fa-toast-right, 16px);
  bottom: var(--fa-toast-bottom, auto);
  left: var(--fa-toast-left, auto);
  display: grid;
  gap: 12px;
  padding: 8px;
  max-height: var(--fa-toast-max-height, calc(100vh - 100px));
  overflow-y: auto;
  width: var(--fa-toast-width, min(344px, calc(100vw - 32px)));
  max-width: calc(100vw - 24px);
  opacity: 0;
  visibility: hidden;
  color: var(--ink);
  font-family: var(--fa-font-sans);
  font-size: 16px;
  line-height: normal;
  font-synthesis: none;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease;
}

.stack,
.stack * {
  box-sizing: border-box;
}

.stack button {
  font: inherit;
}

.stack button:focus-visible {
  outline: 2px solid #3458f5;
  outline-offset: 2px;
}

.stack:global(.is-positioned) {
  opacity: 1;
  visibility: visible;
}

.stack:global(.fotogenic-ai-notification-stack--center-open) {
  opacity: 0;
  visibility: hidden;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 9px 7px 9px 10px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd1da;
  border-left: 2px solid #6d7889;
  border-radius: 9px;
  box-shadow: 0 2px 7px rgba(20, 28, 40, .12);
  pointer-events: none;
  animation: toast-enter .2s cubic-bezier(.22, 1, .36, 1) both;
}

.toast.is-closing {
  pointer-events: none;
  animation: toast-exit 160ms cubic-bezier(.4, 0, 1, 1) both;
}

.success {
  border-left-color: var(--success);
}

.warning {
  border-left-color: #bd7b1d;
}

.danger,
.error {
  border-left-color: #b9433a;
}

.info {
  border-left-color: #6d7889;
}

.icon {
  display: grid;
  align-self: center;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #536175;
  background: #f1f3f6;
  border-radius: 7px;
}

.success .icon {
  color: var(--success);
  background: #eaf7ef;
}

.warning .icon {
  color: #a7660d;
  background: #fff4df;
}

.danger .icon,
.error .icon {
  color: #b9433a;
  background: #fff0ef;
}

.copy {
  display: grid;
  align-self: center;
  gap: 2px;
  min-width: 0;
}

.copy strong {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -.005em;
}

.copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.actions button {
  min-height: 24px;
  margin: 0;
  padding: 0;
  color: #35445e;
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: #aeb5c0;
  text-underline-offset: 3px;
  cursor: pointer;
  pointer-events: auto;
}

.dismiss {
  display: grid;
  align-self: center;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  color: #687386;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  pointer-events: auto;
}

.dismiss:hover {
  color: var(--ink);
  background: #f2f4f7;
}

.progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #cbd2dc;
  transform-origin: left;
  animation: toast-progress var(--toast-duration) linear forwards;
}

.success .progress {
  background: #6eb58d;
}

.warning .progress {
  background: #d9a44e;
}

.danger .progress,
.error .progress {
  background: #d77a73;
}

.screenReader {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translate3d(12px, -4px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes toast-exit {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(10px, -3px, 0); }
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 540px) {
  .stack {
    gap: 7px;
    max-width: none;
  }

  .toast {
    grid-template-columns: 26px minmax(0, 1fr) 32px;
    gap: 8px;
    min-height: 0;
    padding: 8px 5px 8px 8px;
    border-radius: 8px;
  }

  .icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
  }

  .icon :global(.fotogenic-ai-icon) {
    width: 15px;
    height: 15px;
    font-size: 15px;
    line-height: 15px;
  }

  .copy strong {
    font-size: 11px;
    line-height: 15px;
  }

  .copy p {
    font-size: 9.5px;
    line-height: 14px;
  }

  .actions {
    gap: 10px;
    margin-top: 2px;
  }

  .actions button {
    font-size: 9px;
  }

  .dismiss {
    width: 32px;
    height: 32px;
  }

  .persistent .actions {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack,
  .toast,
  .progress {
    animation: none;
    transition: none;
  }
}
