/* Shared Toastr presentation; behavior and message content stay with Toastr. */
#toast-container.toast-bottom-right {
    top: auto;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: min(380px, calc(100vw - 48px - env(safe-area-inset-right, 0px)));
}

#toast-container > .toast {
    --av-toast-tone: var(--av-color-primary);
    --av-toast-tint: var(--av-blue-50);
    position: relative;
    width: 100%;
    margin: 10px 0 0;
    padding: 18px 48px 18px 64px;
    border: 1px solid var(--av-color-border);
    border-radius: 14px;
    background: var(--av-surface) !important;
    color: var(--av-color-text);
    box-shadow: 0 8px 28px rgb(15 27 45 / 12%);
    opacity: 1;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#toast-container > .toast::before {
    content: 'i';
    position: absolute;
    top: 14px;
    left: 14px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--av-toast-tint);
    color: var(--av-toast-tone);
    font-size: 20px;
    font-weight: 600;
}

#toast-container > .toast-success {
    --av-toast-tone: var(--bs-success);
    --av-toast-tint: var(--color-success-light);
}
#toast-container > .toast-success::before { content: '✓'; }
#toast-container > .toast-warning {
    --av-toast-tone: var(--av-color-text);
    --av-toast-tint: var(--bs-warning-bg-subtle, var(--av-page));
}
#toast-container > .toast-warning::before { content: '!'; }
#toast-container > .toast-error {
    --av-toast-tone: var(--bs-danger);
    --av-toast-tint: var(--color-danger-light);
}
#toast-container > .toast-error::before { content: '×'; }

#toast-container .toast-title { margin-bottom: 3px; font-weight: 600; }
#toast-container .toast-message a { color: var(--av-color-primary); text-decoration: underline; }
#toast-container .toast-close-button {
    position: absolute;
    top: 8px;
    right: 6px;
    float: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    color: var(--av-color-text-muted);
    text-shadow: none;
    opacity: 1;
    font-size: 22px;
    font-weight: 400;
}
#toast-container .toast-close-button:hover { background: var(--av-page); color: var(--av-color-text); }
#toast-container .toast-close-button:focus-visible {
    outline: 2px solid var(--av-color-primary);
    outline-offset: -2px;
}

@media (max-width: 767.98px) {
    #toast-container.toast-bottom-right {
        right: calc(12px + env(safe-area-inset-right, 0px));
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        width: min(380px, calc(100vw - 24px - env(safe-area-inset-right, 0px) - env(safe-area-inset-left, 0px)));
    }

    body:has(.av-tabbar:not(.is-preview)) #toast-container.toast-bottom-right {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}
