/* Shared notifications. */

.pm-toast-root {
    position: fixed;
    z-index: var(--pm-z-toast);
    top: 18px;
    right: 18px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}

.pm-toast-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-toast {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    overflow: hidden;
    padding: 10px 10px 10px 11px;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius-md);
    background: var(--pm-popover-bg);
    box-shadow: var(--pm-shadow-popover);
    color: var(--pm-text);
    opacity: 0;
    pointer-events: auto;
    transform: translateX(18px) scale(.98);
    animation: pmToastIn 420ms var(--pm-ease-emphasized) forwards;
}

.pm-toast::after {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--pm-green);
    content: "";
}

.pm-toast--error::after {
    background: var(--pm-red);
}

.pm-toast--warning::after {
    background: var(--pm-amber);
}

.pm-toast--info::after {
    background: var(--pm-blue);
}

.pm-toast.is-leaving {
    animation: pmToastOut 280ms var(--pm-ease-standard) forwards;
}

@keyframes pmToastIn {
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes pmToastOut {
    to { opacity: 0; transform: translateX(14px) scale(.98); }
}

.pm-toast__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: var(--pm-green-soft);
    color: var(--pm-green);
}

.pm-toast--error .pm-toast__icon {
    background: var(--pm-red-soft);
    color: var(--pm-red);
}

.pm-toast--warning .pm-toast__icon {
    background: rgba(232, 179, 65, .12);
    color: var(--pm-amber);
}

.pm-toast--info .pm-toast__icon {
    background: rgba(78, 142, 232, .11);
    color: var(--pm-blue);
}

.pm-toast__icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.pm-toast__message {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.pm-toast__title {
    color: var(--pm-text);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.3;
}

.pm-toast__message > span:not(.pm-toast__title),
.pm-toast__message > p {
    margin: 0;
    color: var(--pm-text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.pm-toast__close {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pm-text-muted);
    cursor: pointer;
}

.pm-toast__close:hover {
    background: var(--pm-surface-hover);
    color: var(--pm-text);
}

.pm-toast__close svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

html.is-dark .pm-toast {
    background: var(--pm-popover-bg);
}

@media (max-width: 520px) {
    .pm-toast-root {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .pm-toast {
        min-height: 54px;
    }
}

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