/* Font sizes*/
.fade {
    -o-transition: 0.3s;
    -moz-transition: 0.3s;
    -webkit-transition: 0.3s;
    /* ...and now for the proper property */
    transition: 0.3s;
}

.waiting {
    cursor: wait !important;
}

.BackgroundTint {
    background-color: rgba(0, 0, 0, 0.3);
}

.BackgroundLimo {
    background-color: rgba(0, 0, 0, 0.8);
}

#Toggle-BlackBackground {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 4999;
}

#MessageBox-ScreenCover-Div {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4999;
    background-color: rgba(16, 20, 26, 0.42);
    /* Centring context: MessageBox opens this as display:flex, so the dialog
     is dead-centre both axes with no transform arithmetic to knock off. */
    align-items: center;
    justify-content: center;
}

    #MessageBox-ScreenCover-Div #MessageBox-Outer-Div {
        /* Centred by the flex cover; self-positioning removed. Clamps keep long
     messages inside the viewport (the old absolute box got this free). */
        position: relative;
        margin: 0;
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        overflow: auto;
        background: var(--panel);
        color: var(--text);
        border-radius: 14px;
        border: 1px solid var(--border);
        box-shadow: 0 12px 32px rgba(16, 20, 26, 0.18);
        display: flex;
        flex-direction: column;
        min-width: 320px;
        width: auto;
        height: auto;
        max-width: 440px;
        max-height: 80vh;
        z-index: 5000;
        padding: 22px 24px 18px;
    }

        #MessageBox-ScreenCover-Div #MessageBox-Outer-Div #MessageBox-Div {
            position: relative;
            width: 100%;
            height: 100%;
        }

        #MessageBox-ScreenCover-Div #MessageBox-Outer-Div #MessageBox-Message {
            text-align: left;
            margin: 0;
            position: relative;
            box-sizing: border-box;
            font-family: var(--font-sans);
            font-size: 0.875rem;
            line-height: 1.5;
            color: var(--text);
            word-wrap: break-word !important;
            white-space: pre-wrap !important;
            padding: 4px 2px 18px;
        }

            #MessageBox-ScreenCover-Div #MessageBox-Outer-Div #MessageBox-Message.Large {
                max-width: 80% !important;
                height: 70% !important;
            }

        #MessageBox-ScreenCover-Div #MessageBox-Outer-Div #Button-Div {
            display: flex;
            justify-content: flex-end;
            gap: 9px;
            margin-top: auto;
        }

            #MessageBox-ScreenCover-Div #MessageBox-Outer-Div #Button-Div .OkayButton {
                min-width: 64px;
                min-height: 34px;
                font-family: var(--font-sans);
                font-size: 0.8125rem;
                font-weight: 600;
                border-radius: 9px;
                padding: 7px 16px;
                cursor: pointer;
                border: 1px solid transparent;
                transition: background 0.13s ease, color 0.13s ease;
            }

    #MessageBox-ScreenCover-Div #Button-Div .OkayButton.accept {
        background: var(--accent);
        color: var(--on-accent);
    }

        #MessageBox-ScreenCover-Div #Button-Div .OkayButton.accept:hover {
            background: var(--accent-strong);
        }

    #MessageBox-ScreenCover-Div #Button-Div .OkayButton.cancel {
        background: transparent;
        color: var(--muted);
        border-color: var(--border);
    }

        #MessageBox-ScreenCover-Div #Button-Div .OkayButton.cancel:hover {
            background: var(--row-hover);
            color: var(--text);
        }

    #MessageBox-ScreenCover-Div #MessageBox-Outer-Div.Large {
        width: 800px !important;
        height: 350px !important;
    }

#PopupBox {
    display: none;
    top: 10px;
    left: 10px;
    width: auto;
    height: 10px;
    position: absolute;
    font-family: var(--font-sans);
    z-index: 50000;
}

#DisplayImage {
    z-index: 4000000;
    position: fixed;
    float: unset;
    display: none;
    width: 300px;
    height: 100px;
    background: var(--panel);
    color: var(--text);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: solid 1px var(--border);
}

    #DisplayImage #DownloadAttach {
        position: relative;
        float: left;
        width: 100%;
        height: 100%;
    }

    #DisplayImage img {
        width: 100%;
        height: 100%;
    }

    #DisplayImage a {
        position: relative;
        float: left;
    }

/* MessageBox entrance: fade backdrop + pop dialog (mirrors Confirm) */
@keyframes mb-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mb-dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

#MessageBox-ScreenCover-Div {
    animation: mb-backdrop-in 0.16s ease both;
}

    #MessageBox-ScreenCover-Div #MessageBox-Outer-Div {
        animation: mb-dialog-in 0.18s ease both;
    }

/* ---- Titled message boxes: same idiom as the Confirm dialogs ---- */
#MessageBox-Outer-Div .mb-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 10px;
}

#MessageBox-Outer-Div .mb-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-pale);
    color: var(--brand);
}

#MessageBox-Outer-Div .mb-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

#MessageBox-Outer-Div .mb-msg-titled {
    padding-left: 49px;
    color: var(--muted);
}