#toast-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;

    pointer-events: none;
}

.toast.is-hidden {
    display: none;
}

.toast {
    position: relative;

    display: flex;
    min-width: 300px;
    max-width: min(400px, calc(100vw - 32px));
    width: max-content;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.04);
    background-color: #fff;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 500;

    gap: 16px;
    pointer-events: auto;

    opacity: 0;
    transform: translateX(150%) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.is-visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast.is-hiding {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
}

.toast .toast-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
}

.toast.info .toast-icon {
    color: #4955C3;
}

.toast.success .toast-icon  {
    color: #06B26D;
}

.toast.warning .toast-icon  {
    color: #EE734E;
}

.toast.error .toast-icon  {
    color: #D30383;
}

.toast-title {
    padding-right: 22px;
    font-weight: 600;
    color: #111827;
}

.toast-message {
    font-weight: 400;
    color: #4b5563;
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.toast-message span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.toast-link {
    color: #4955C3;
    padding: 6px;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.toast-link svg {
    width: 16px;
    height: 16px;
}

.toast-icon {
    margin-top: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;

    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s ease, opacity 0.2s ease;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    width: 28px;
    height: 28px;
    border-radius: 8px;

    background: transparent;
    border: 0;

    opacity: 0;
    pointer-events: none;
}

.toast:hover .toast-close,
.toast:focus-within .toast-close {
    opacity: 1;
    pointer-events: auto;
}

.toast-close:hover {
    color: #111827;
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

.toast-progress {
    height: 3px;
    width: 100%;
    margin-top: 8px;
    border-radius: 999px;

    background: currentColor;
    opacity: 0.28;

    animation: toast-progress linear forwards;
    animation-duration: var(--toast-duration, 0ms);
    animation-play-state: running;

    transform-origin: left;
}

.toast.info .toast-progress    { color: #4955C3; }
.toast.success .toast-progress { color: #06B26D; }
.toast.warning .toast-progress { color: #EE734E; }
.toast.error .toast-progress   { color: #D30383; }

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 524px) {
    #toast-container {
        right: 12px;
        left: 12px;
        bottom: 12px;
        align-items: stretch;
    }

    .toast {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(120%) scale(0.97);
    }

    .toast.is-hiding {
        transform: translateY(120%) scale(0.97);
    }
}
