.moto-message-host-root,
.moto-message-host {
  pointer-events: none;
}

.moto-message-host-root {
  position: fixed;
  z-index: 5000;
  inset: 0;
}

.moto-message-stack {
  position: fixed;
  display: flex;
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  flex-direction: column;
  gap: 0.75rem;
  overflow: visible;
}

.moto-message-stack--top {
  top: var(--moto-message-offset);
  left: 50%;
  transform: translateX(-50%);
}

.moto-message-stack--top-left,
.moto-message-stack--top-right {
  top: var(--moto-message-offset);
}

.moto-message-stack--top-left,
.moto-message-stack--bottom-left {
  left: var(--moto-message-offset);
}

.moto-message-stack--top-right,
.moto-message-stack--bottom-right {
  right: var(--moto-message-offset);
}

.moto-message-stack--bottom,
.moto-message-stack--bottom-left,
.moto-message-stack--bottom-right {
  bottom: var(--moto-message-offset);
  flex-direction: column-reverse;
}

.moto-message {
  display: grid;
  min-height: 4.25rem;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid #d6dbe1;
  border-left: 4px solid currentColor;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 0.5rem 1.75rem rgb(24 36 48 / 14%);
  color: #24313d;
  pointer-events: auto;
  animation: moto-message-enter 180ms ease-out both;
}

.moto-message--success {
  border-left-color: #147d4a;
}

.moto-message--warning {
  border-left-color: #8a5500;
}

.moto-message--error {
  border-left-color: #a52834;
}

.moto-message--info {
  border-left-color: #005eb1;
}

.moto-message__icon {
  width: 1.5rem;
  height: 1.5rem;
  color: currentColor;
}

.moto-message--success .moto-message__icon {
  color: #147d4a;
}

.moto-message--warning .moto-message__icon {
  color: #8a5500;
}

.moto-message--error .moto-message__icon {
  color: #a52834;
}

.moto-message--info .moto-message__icon {
  color: #005eb1;
}

.moto-message__text {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #24313d;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.moto-message__repeat {
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.moto-message__close {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 3px;
  color: #424d57;
  font-size: 1.5rem;
  line-height: 1;
  pointer-events: auto;
}

.moto-message__close:hover {
  background: #eef1f4;
  color: #17212a;
}

.moto-message__close:focus-visible {
  outline: 3px solid #005eb1;
  outline-offset: 2px;
}

@keyframes moto-message-enter {
  from {
    opacity: 0;
    transform: translateY(-0.375rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 899px) {
  .moto-message-stack {
    width: min(26rem, calc(100vw - 2rem));
  }
}

@media (max-width: 599px) {
  .moto-message-stack--top-left,
  .moto-message-stack--top-right,
  .moto-message-stack--bottom-left,
  .moto-message-stack--bottom-right {
    right: 1rem;
    left: 1rem;
    width: auto;
  }

  .moto-message-stack--bottom-left,
  .moto-message-stack--bottom-right {
    bottom: max(var(--moto-message-offset), env(safe-area-inset-bottom));
  }

  .moto-message {
    gap: 0.625rem;
    padding: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .moto-message {
    animation: none;
  }
}