/* Shared toast notifications */
.emai-toast-host {
    position: fixed;
    z-index: 12000;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.55rem;
    width: min(calc(100vw - 2rem), 24rem);
    pointer-events: none;
}

.emai-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem 0.75rem;
    align-items: start;
    padding: 0.9rem 0.95rem;
    border-radius: 14px;
    border: 1px solid transparent;
    box-shadow: 0 16px 40px -18px rgba(14, 17, 21, 0.45);
    background: #fff;
    color: #12151a;
    font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    font-weight: 550;
    line-height: 1.45;
    animation: emai-toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.emai-toast.is-leaving {
    animation: emai-toast-out 0.22s ease forwards;
}

.emai-toast__msg {
    margin: 0;
    grid-column: 1;
}

.emai-toast__close {
    grid-column: 2;
    grid-row: 1;
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.55;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.1rem;
    border-radius: 6px;
}

.emai-toast__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.emai-toast__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.emai-toast__btn {
    appearance: none;
    border: 1.5px solid rgba(18, 21, 26, 0.14);
    background: #fff;
    color: #12151a;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 650;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
}

.emai-toast__btn--primary {
    background: #da0808;
    border-color: transparent;
    color: #fff;
}

.emai-toast--ok {
    background: #ecfdf7;
    border-color: #7dd3b0;
    color: #0d7a53;
}

.emai-toast--err {
    background: #fff5f5;
    border-color: #f5b5b5;
    color: #9b1c1c;
}

.emai-toast--info {
    background: #fffbeb;
    border-color: #f5d78e;
    color: #92400e;
}

@keyframes emai-toast-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes emai-toast-out {
    to {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

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

@media (max-width: 520px) {
    .emai-toast-host {
        left: 1rem;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        width: auto;
    }
}
