#rponto-toast-region {
    position: fixed;
    z-index: 3000;
    top: calc(env(safe-area-inset-top, 0px) + var(--rponto-toast-offset, 16px));
    right: max(16px, env(safe-area-inset-right, 0px));
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--rponto-toast-offset, 16px) - 16px);
    display: grid;
    align-content: start;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2px;
    pointer-events: none;
    scrollbar-width: thin;
}

body.rponto-notify-below-header {
    --rponto-toast-offset: 76px;
}

.rponto-toast {
    --toast-accent: #2563eb;
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 10px;
    align-items: start;
    overflow: hidden;
    padding: 14px 12px;
    border: 1px solid #dbe2ea;
    border-left: 4px solid var(--toast-accent);
    border-radius: 12px;
    background: #ffffff;
    color: #17212b;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
}

.rponto-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.rponto-toast.is-leaving {
    opacity: 0;
    transform: translateY(-6px);
}

.rponto-toast--success { --toast-accent: #16834a; }
.rponto-toast--error { --toast-accent: #c62828; }
.rponto-toast--warning { --toast-accent: #a86600; }
.rponto-toast--info { --toast-accent: #1769aa; }

.rponto-toast__icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--toast-accent) 12%, white);
    color: var(--toast-accent);
    font-size: 17px;
    font-weight: 700;
}

.rponto-toast__content {
    min-width: 0;
}

.rponto-toast__title {
    display: block;
    margin: 1px 0 3px;
    color: #17212b;
    font-size: 14px;
    line-height: 1.35;
}

.rponto-toast__message {
    margin: 0;
    color: #3e4b59;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.rponto-toast__close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #596675;
    cursor: pointer;
    font: inherit;
    font-size: 23px;
    line-height: 1;
}

.rponto-toast__close:hover,
.rponto-toast__close:focus-visible {
    background: #eef2f6;
    color: #17212b;
}

.rponto-toast__close:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 1px;
}

.rponto-toast__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    background: var(--toast-accent);
    animation: rponto-toast-progress 3000ms linear forwards;
}

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

@media (max-width: 600px) {
    #rponto-toast-region {
        right: max(10px, env(safe-area-inset-right, 0px));
        width: calc(100vw - 20px);
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--rponto-toast-offset, 16px) - 10px);
        gap: 8px;
    }

    .rponto-toast {
        grid-template-columns: 30px minmax(0, 1fr) 32px;
        gap: 8px;
        padding: 12px 10px;
        border-radius: 10px;
    }

    .rponto-toast__icon {
        width: 28px;
        height: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rponto-toast {
        transition: none;
        transform: none;
    }

    .rponto-toast__progress {
        animation: none;
        transform: scaleX(1);
    }
}
