.td-toast-region {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    z-index: 2147483647;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.td-toast {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 18px 16px 18px 20px;
    color: #fff;
    background: #1c1c1e;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
    pointer-events: auto;
    animation: td-toast-enter .28s cubic-bezier(.2, .8, .2, 1) both;
}

.td-toast--success { background: #147a3c; }
.td-toast--danger { background: #be3535; }
.td-toast--warning { color: #1c1c1e; background: #e6ad3c; }
.td-toast--info { background: #176dac; }

.td-toast__title {
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.td-toast__message {
    font-size: 14px;
    line-height: 1.45;
}

.td-toast__close {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    place-items: center;
    color: inherit;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.td-toast__close:hover,
.td-toast__close:focus-visible {
    background: rgba(255, 255, 255, .14);
    outline: none;
}

.td-toast--warning .td-toast__close:hover,
.td-toast--warning .td-toast__close:focus-visible {
    background: rgba(0, 0, 0, .1);
}

.td-toast.is-leaving {
    animation: td-toast-leave .2s ease-in both;
}

@keyframes td-toast-enter {
    from { opacity: 0; transform: translateY(-12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes td-toast-leave {
    to { opacity: 0; transform: translateY(-8px) scale(.98); }
}

@media (max-width: 767px) {
    .td-toast-region {
        top: max(12px, env(safe-area-inset-top));
        right: 16px;
        width: calc(100vw - 32px);
    }
}

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