.app-toast,
.app-alert-dialog {
  font-family: inherit;
}

.app-notification-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(430px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1300;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: min(430px, calc(100vw - 32px));
  padding: 15px 16px;
  border: 1px solid #d8e1eb;
  border-radius: 16px;
  background: #ffffff;
  color: #1b2738;
  box-shadow: 0 20px 55px rgba(15, 23, 42, .16), 0 4px 14px rgba(15, 23, 42, .08);
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.app-notification-stack .app-toast {
  position: relative;
  inset: auto;
  width: 100%;
  pointer-events: auto;
}

.app-toast.is-entering {
  animation: app-toast-in .28s ease-out both;
}

.app-toast.is-closing {
  animation: app-toast-out .2s ease-in both;
  pointer-events: none;
}

.app-toast--success {
  border-color: #b9e3c8;
}

.app-toast--info {
  border-color: #b8d8ef;
}

.app-toast--warning {
  border-color: #efd59b;
}

.app-toast__icon,
.app-alert-dialog__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.app-toast--success .app-toast__icon {
  background: #e4f7ea;
  color: #18723d;
}

.app-toast--info .app-toast__icon {
  background: #e6f3fc;
  color: #15608d;
}

.app-toast--warning .app-toast__icon {
  background: #fff4d9;
  color: #8a5b00;
}

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

.app-toast__content strong {
  display: block;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.app-toast__content p {
  margin: 4px 0 0;
  color: #5b6879;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.app-toast__close,
.app-alert-dialog__close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #718096;
  cursor: pointer;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.app-toast__close:hover,
.app-toast__close:focus-visible,
.app-alert-dialog__close:hover,
.app-alert-dialog__close:focus-visible {
  background: #f1f5f9;
  color: #1b2738;
}

.app-toast__close:focus-visible,
.app-alert-dialog__close:focus-visible,
.app-alert-dialog__button:focus-visible {
  outline: 3px solid rgba(215, 25, 32, .24);
  outline-offset: 2px;
}

.app-alert-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 1400;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: rgba(15, 23, 42, .54);
  color: #1b2738;
  display: none;
  place-items: center;
}

.app-alert-dialog[open] {
  display: grid;
}

.app-alert-dialog::backdrop {
  background: transparent;
}

.app-alert-dialog__surface {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid #e4eaf1;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}

.app-alert-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.app-alert-dialog__heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding-right: 28px;
}

.app-alert-dialog__icon {
  background: #fff0f0;
  color: #b4232b;
  font-size: 18px;
}

.app-alert-dialog--warning .app-alert-dialog__icon {
  background: #fff4d9;
  color: #8a5b00;
}

.app-alert-dialog--warning .app-alert-dialog__eyebrow {
  color: #8a5b00;
}

.app-alert-dialog--info .app-alert-dialog__icon {
  background: #e6f3fc;
  color: #15608d;
}

.app-alert-dialog--info .app-alert-dialog__eyebrow {
  color: #15608d;
}

.app-alert-dialog__eyebrow {
  display: block;
  margin: 1px 0 6px;
  color: #b4232b;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.app-alert-dialog h2 {
  margin: 0;
  color: #172235;
  font-size: clamp(20px, 3vw, 25px);
  font-weight: 850;
  line-height: 1.2;
}

.app-alert-dialog p {
  margin: 10px 0 0;
  color: #5b6879;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.app-alert-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}

.app-alert-dialog__button {
  min-width: 92px;
  padding: 11px 18px;
  border: 1px solid #d8e1eb;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.app-alert-dialog__button:hover {
  background: #f8fafc;
}

.app-alert-dialog__button--primary {
  border-color: #c21820;
  background: #d71920;
  color: #ffffff;
}

.app-alert-dialog__button--primary:hover {
  border-color: #a9141a;
  background: #b9151c;
}

[dir="rtl"] .app-notification-stack {
  right: auto;
  left: 24px;
}

[dir="rtl"] .app-alert-dialog__close {
  right: auto;
  left: 14px;
}

[dir="rtl"] .app-alert-dialog__heading {
  padding-right: 0;
  padding-left: 28px;
}

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

@keyframes app-toast-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -8px, 0);
  }
}

@media (max-width: 720px) {
  .app-toast {
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
  }

  .app-notification-stack {
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
  }

  .app-notification-stack .app-toast {
    width: 100%;
  }

  [dir="rtl"] .app-notification-stack {
    right: 16px;
    left: 16px;
  }

  .app-alert-dialog {
    padding: 16px;
  }

  .app-alert-dialog__surface {
    max-height: calc(100vh - 32px);
    padding: 24px 20px 20px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast.is-entering,
  .app-toast.is-closing {
    animation: none;
  }
}
