/* The one canonical sheet for the dom.js global toast stack.
 *
 * dom.js `showToast` injects `#global-toast-container` straight into the document
 * body of EVERY surface that loads dom.js — the base shell and the eight standalone
 * documents alike — so its styling cannot live in a page stylesheet: pages
 * without the right sheet rendered the stack as unpositioned body text
 * (Audit #1787260302310 fixes BUG-6240). The rules are therefore declared once,
 * here, and this sheet is linked wherever dom.js is loaded: base.html plus
 * login, register, forgot_password, reset_password, account_appeal, welcome,
 * party_detail and session_runtime, which carry their own <head>.
 *
 * Page stylesheets must not re-declare .toast-container/.toast* rules; the six
 * per-page copies this sheet replaces (discovery, money, profile-safety,
 * creator-profile, referrals, session-runtime) were removed with it. Colours
 * read the root.css theme roles only, so light mode and the deep AA variants
 * apply without a second fork. The close control's 44px logical hit floor
 * stays in reader.css (Audit #1787260301009, BUG-4871) and binds on every
 * surface that loads it.
 */

/* Centred without a physical translate: a logical inset-inline-start of 50% paired
 * with translateX(-50%) resolves to right: 50% under dir="rtl" while the translate
 * still moves left, pushing the stack off screen on Arabic and Urdu pages
 * (Audit #1787260302634 fixes BUG-6476). Both inline insets at 0 with auto margins
 * centre the shrink-wrapped stack identically in either direction. */
.toast-container {
    position: fixed;
    inset-block-end: 2rem;
    inset-inline: 0;
    margin-inline: auto;
    width: max-content;
    max-width: min(calc(100% - 2rem), 40rem);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px var(--tint-black-400);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    pointer-events: auto;
}

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

.toast-success {
    border-color: var(--theme-success);
}

.toast-success i {
    color: var(--theme-success);
}

.toast-error {
    border-color: var(--error);
}

.toast-error i {
    color: var(--error);
}

.toast-warning {
    border-color: var(--theme-warning);
}

.toast-warning i {
    color: var(--theme-warning);
}

.toast-info {
    border-color: var(--theme-primary);
}

.toast-info i {
    color: var(--theme-primary);
}

.toast-close {
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
}

/* Raised above the mobile action bars and composer, and narrowed to the
 * viewport, exactly as the session-runtime copy the stack was densest on. */
@media (max-width: 768px) {
    .toast-container {
        inset-block-end: 70px;
        width: 90%;
    }

    .toast {
        width: 100%;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}
