.notifications {
    position: fixed;
    z-index: 9999;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

body:has(.app-topbar) .notifications {
    top: 76px;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 12px 8px 14px 16px;
    overflow: hidden;
    border-radius: 8px;
    border: 0.5px solid #e5e3ef;
    border-left-width: 4px;
    background: #fff;
    color: #2d2d3e;
    box-shadow: 0 4px 16px rgba(45, 45, 62, 0.10), 0 1px 4px rgba(45, 45, 62, 0.06);
    pointer-events: auto;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    animation: toastIn 0.18s ease-out;
}

.toast.is-leaving {
    animation: toastOut 0.18s ease forwards;
}

.toast-icon {
    font-size: 18px;
    line-height: 1;
    width: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    text-align: center;
}

.toast-message {
    flex: 1;
    margin: 0;
    padding-top: 1px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #2d2d3e;
    user-select: text;
}

.toast-close {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-top: -8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #2d2d3e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
}

.toast-close i {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f5f4f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover i {
    background: #e5e3ef;
}

.toast-close:focus-visible {
    outline: 2px solid #2d2d3e;
    outline-offset: -2px;
}

.toast-time {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    transform-origin: left center;
    animation-name: toastTime;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.toast.is-paused .toast-time {
    animation-play-state: paused;
}

.toast.success {
    background: #e8f5e9;
    border-left-color: #2e7d32;
}

.toast.success .toast-icon {
    color: #2e7d32;
}

.toast.success .toast-time {
    background: #2e7d32;
}

.toast.warning {
    background: #fff3e0;
    border-left-color: #bf360c;
}

.toast.warning .toast-icon {
    color: #bf360c;
    background: transparent;
}

.toast.warning .toast-time {
    background: #bf360c;
}

.toast.error {
    background: #fce4ec;
    border-left-color: #c62828;
}

.toast.error .toast-icon {
    color: #c62828;
    background: transparent;
}

.toast.error .toast-time {
    background: #c62828;
}

.toast.info {
    background: #e3f2fd;
    border-left-color: #1565c0;
}

.toast.info .toast-icon {
    color: #1565c0;
    background: transparent;
}

.toast.info .toast-time {
    background: #1565c0;
}

@keyframes toastIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes toastOut {
    to { opacity: 0; }
}

@keyframes toastTime {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

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

    .toast-time {
        display: none;
    }
}
