.app-notifications {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 99999;
    display: flex;
    width: min(380px, calc(100vw - 32px));
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 15px 20px 17px;
    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: 8px;
    color: #fff;
    background: #176f81;
    box-shadow: 0 8px 24px rgb(0 0 0 / 28%);
    word-break: break-word;
    pointer-events: auto;
    animation: app-toast-enter 180ms ease-out both;
}

.app-toast--success {
    background: #21843a;
}

.app-toast--error {
    background: #bd2d3a;
}

.app-toast--warning {
    color: #17130a;
    background: #eab31e;
}

.app-toast--leaving {
    pointer-events: none;
    animation: app-toast-leave 180ms ease-in both;
}

.app-toast__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.app-toast__title {
    min-width: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.app-toast__close {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    margin: -5px -7px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: inherit;
    background: transparent;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.app-toast__close:hover {
    background: rgb(255 255 255 / 14%);
    opacity: 1;
}

.app-toast__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.app-toast--interactive {
    cursor: pointer;
}

.app-toast--interactive:focus-visible {
    outline: 2px solid rgb(255 255 255 / 90%);
    outline-offset: 2px;
}

.app-toast__message {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    white-space: pre-line;
}

.app-toast__footer {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.2;
    opacity: 0.82;
}

.app-toast__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgb(255 255 255 / 72%);
    transform: scaleX(1);
    transform-origin: left;
    transition: transform 250ms linear;
    will-change: transform;
}

@keyframes app-toast-enter {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes app-toast-leave {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

@media (max-width: 480px) {
    .app-notifications {
        right: max(12px, env(safe-area-inset-right));
        left: max(12px, env(safe-area-inset-left));
        width: auto;
    }

    .app-toast {
        padding: 14px 16px 16px;
    }

    .app-toast__title {
        font-size: 16px;
    }

    .app-toast__message {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast,
    .app-toast--leaving {
        animation-duration: 1ms;
    }
}
