#toast {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: min(29rem, calc(100vw - 1.5rem));
    z-index: 10000;
    isolation: isolate;
    pointer-events: auto;
}

#toast:not(.show) {
    pointer-events: none;
}

#toast .icon {
    flex: 0 0 auto;
}

#toast-message {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

#toast-actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

#toast-actions .toast-retry-btn,
#toast-actions #toast-undo-btn {
    appearance: none;
    min-height: 2rem;
    margin: 0;
    padding: 0.375rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

#toast-actions .toast-retry-btn:hover,
#toast-actions #toast-undo-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

#toast-actions .toast-retry-btn:focus-visible,
#toast-actions #toast-undo-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

#toast-actions .toast-close {
    appearance: none;
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

#toast-actions .toast-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

#toast-actions .toast-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    #toast {
        align-items: flex-start;
        gap: 0.625rem;
    }

    #toast-actions .toast-close {
        width: 1.875rem;
        height: 1.875rem;
    }
}
