











.toast-host {
    position: fixed;
    bottom: 24px;
    inset-inline-start: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(390px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 15px;

    background: var(--section-bg, #FFFFFF);
    color: var(--text-dark, #2C3E50);
    border: 1px solid var(--border-color, #E4E9ED);
    border-inline-start: 4px solid var(--toast-accent, #28B5B5);
    border-radius: 14px;

    box-shadow: 0 18px 40px -14px rgba(15, 23, 42, 0.30), 0 4px 12px rgba(15, 23, 42, 0.07);

    font-size: 14px;
    line-height: 1.6;
    font-weight: 600;

    pointer-events: auto;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    animation: toastIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

.toast.is-leaving {
    animation: toastOut 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.toast__icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: var(--toast-accent, #28B5B5);
    font-size: 15px;
}

.toast__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 3px;
    min-width: 0;
}

.toast__title {
    font-weight: 800;
    font-size: 13.5px;
    color: var(--toast-accent, #28B5B5);
}

.toast__text {
    font-weight: 600;
    color: var(--text-dark, #2C3E50);
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.toast__close {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-light, #6C7A89);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, background-color 0.25s ease;
}

.toast:hover .toast__close,
.toast__close:focus-visible { opacity: 1; }

.toast__close:hover {
    background: var(--bg-color, #F8FBFA);
    color: var(--text-dark, #2C3E50);
}

.toast__bar {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--border-color, #E4E9ED);
}

.toast__bar::after {
    content: '';
    display: block;
    height: 100%;
    background: var(--toast-accent, #28B5B5);
    transform-origin: right center;
    animation: toastBar var(--toast-duration, 3600ms) linear forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(10px) scale(0.96); }
}

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

 
body.dark-mode .toast {
    background: #131C29;
    color: #E2E8F0;
    border-color: #2A3748;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .toast__icon {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toast__text { color: #E2E8F0; }
body.dark-mode .toast__close { color: #8B99AD; }
body.dark-mode .toast__close:hover { background: #1B2634; color: #E2E8F0; }
body.dark-mode .toast__bar { background: #223046; }

 
@media (max-width: 768px) {
    .toast-host {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
        inset-inline: 16px;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast__bar::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    .toast { opacity: 1; transform: none; }
}