/* Legacy fragments must also stay out of layout while being converted to toasts. */
.alert.success, .alert.error, .alert.warning, .alert.info { display:none!important; }

.notification-stack {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 12px;
    z-index: 120;
    width: min(380px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.app-notification {
    --notification-color: var(--blue);
    min-height: 58px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--notification-color), var(--line) 35%);
    border-left: 4px solid var(--notification-color);
    border-radius: 8px;
    padding: 10px 8px 10px 12px;
    background: color-mix(in srgb, var(--surface), var(--notification-color) 7%);
    color: var(--ink);
    box-shadow: 0 14px 34px rgba(16, 24, 40, .2);
    pointer-events: auto;
    animation: notification-slide-in .28s ease-out both;
}

.app-notification[data-type="success"] { --notification-color: #12a36d; }
.app-notification[data-type="warning"] { --notification-color: #e7a008; }
.app-notification[data-type="error"] { --notification-color: #d92d20; }
.app-notification[data-type="info"] { --notification-color: #087fff; }

.app-notification > .material-icons-round {
    color: var(--notification-color);
    font-size: 25px;
}

.notification-message {
    min-width: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.notification-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.notification-close:hover { background: color-mix(in srgb, var(--notification-color), transparent 88%); color: var(--ink); }
.notification-close .material-icons-round { font-size: 20px; }

.app-notification.is-leaving {
    animation: notification-slide-out .38s ease-in both;
}

@keyframes notification-slide-in {
    from { opacity: 0; transform: translateX(calc(100% + 20px)); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes notification-slide-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(calc(100% + 20px)); }
}

@media (prefers-reduced-motion: reduce) {
    .app-notification,
    .app-notification.is-leaving { animation-duration: .01ms; }
}

@media (max-width: 620px) {
    .notification-stack { top: calc(var(--topbar-h) + 8px); right: 8px; width: calc(100vw - 16px); }
}
