/* Shared toast position: fixed to the browser viewport, bottom-right. */
#gwj-flash-host,
.gwj-toast-stack {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    transform: none;
    width: min(420px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    pointer-events: none;
    overflow: auto;
}

#gwj-flash-host .alert,
#gwj-flash-host .gwj-flash,
.gwj-toast-stack .toast {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: max-content;
    max-width: 100%;
    margin: 0;
    pointer-events: auto;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.alert-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    transform: none;
    width: min(420px, calc(100vw - 40px));
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow-wrap: anywhere;
}

#gwj-flash-host .alert-fixed {
    position: relative;
    bottom: auto;
    right: auto;
    width: max-content;
    max-width: 100%;
    z-index: auto;
}

/* Public scroll button sits at this corner (z-index 10000). Keep it under the toast. */
html body #back-to-top-button,
html body.home-page #back-to-top-button {
    z-index: 9998;
}

@media (max-width: 575.98px) {
    #gwj-flash-host,
    .gwj-toast-stack,
    .alert-fixed {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }

    #gwj-flash-host .alert,
    #gwj-flash-host .gwj-flash,
    #gwj-flash-host .alert-fixed,
    .gwj-toast-stack .toast {
        width: 100%;
    }
}
