.notification-container {
    position: fixed;
    top: auto;
    right: auto;
    left: 50%;
    bottom: 24px;
    z-index: 400;
    width: max-content;
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
    pointer-events: none;
}

.notification-container .notification {
    position: relative;
    inset: auto;
    margin: 0;
    width: auto;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    max-width: 100%;
    padding: 8px 8px 8px 12px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--addbtnbg) 28%, var(--border));
    border-radius: 18px;
    color: var(--text);
    font-family: var(--font-body);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(14px) scale(0.97);
    transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.notification-container .notification.show {
    opacity: 1;
    transform: none;
}

.notification-container .notification-plain {
    padding-right: 18px;
}

.toast-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.12);
}

.toast-icon i.bx {
    font-size: 20px;
    color: var(--addbtnbg);
}

.toast-text {
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.toast-timer {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.toast-timer svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.toast-timer circle {
    fill: none;
    stroke-width: 3;
}

.toast-timer-track {
    stroke: var(--border);
}

.toast-timer-bar {
    stroke: var(--addbtnbg);
    stroke-linecap: round;
    stroke-dasharray: 97.4;
    stroke-dashoffset: 0;
}

.notification.show .toast-timer-bar {
    animation: toastCountdown var(--toast-duration, 5s) linear forwards;
}

.toast-timer-count {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

@keyframes toastCountdown {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: 97.4; }
}

.notification-container .undo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 6px;
    padding: 10px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--addbtnbg);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.notification-container .undo-btn i.bx {
    font-size: 17px;
    color: inherit;
    cursor: pointer;
}

.notification-container .undo-btn:hover {
    background: var(--addbtnbg);
    color: #ffffff;
}

.notification-container .undo-btn:active {
    transform: scale(0.97);
}

@media (max-width: 560px) {
    .notification-container {
        bottom: 12px;
        width: calc(100vw - 24px);
    }

    .notification {
        width: 100%;
    }

    .toast-text {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification {
        transform: none;
    }

    .notification.show .toast-timer-bar {
        animation: none;
    }
}
