/* ---------- Toast Messages ---------- */

/* the 'stack' of messages - multiple messages can display in a stack */
.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 48px));
    pointer-events: none;
}

/* an individual slice of toast */
.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 12px 16px 16px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  border-left: 4px solid var(--toast-info);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  animation: toast-in 250ms ease-out both;
}

/* toast type specifics */
.toast--success {
    border-left-color: var(--toast-success);
}
.toast--error {
    border-left-color: var(--toast-error);
}

.toast__icon {
    flex:0 0 auto; margin-top:1px;
}
.toast--success .toast__icon {
    color: var(--toast-success);
}
.toast--error .toast__icon {
    color: var(--toast-error);
}
.toast--info .toast__icon {
    color: var(--toast-info);
}

.toast__body {
    flex: 1 1 auto;
    min-width: 0;
}

.toast__title {
    margin: 0 0 2px;
    font-weight: 700;
}

.toast__message {
    margin: 0;
    color: rgba(255,255,255,.85);
    overflow-wrap: anywhere;
}

.toast__close {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: -4px -4px 0 0;
    background: none;
    border: 0;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}
.toast__close:hover,
.toast__close:focus-visible {
    background: rgba(255,255,255,.14);
    color:#fff;
}

.toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom:0;
    height: 3px;
    background: rgba(255,255,255,.28);
    transform-origin: left;
    animation: toast-progress linear forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}
@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(12px);
    }
}
@keyframes toast-progress {
    to {
        transform:scaleX(0);
    }
}

.toast--paused .toast__progress {
    animation-play-state:paused;
}
.toast--leaving {
    animation: toast-out 200ms ease-in forwards;
    pointer-events:none;
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast--leaving { animation-duration:1ms; }
  .toast__progress { display:none; }
}

@media (max-width: 480px) {
  .toast-stack { left:16px; right:16px; bottom:16px; width:auto; }
}


