﻿dialog,
dialog * {
    font-size: 12pt;
    line-height: 1.5em;
}

dialog {
    position: fixed;
    left: 0;
    right: 0;
    width: -moz-fit-content;
    width: -webkit-fit-content;
    width: fit-content;
    height: -moz-fit-content;
    height: -webkit-fit-content;
    height: fit-content;
    margin: auto;
    padding: 1em;
    background: white;
    color: black;
    border: solid 1px #333366;
    display: flex;
    flex-direction: column;
    min-width: 20em;
    /*max-width: 100%;*/
    /*max-height: 100%;*/
    /*margin-top: 0px;*/
    /*top: 0px;*/
}

    dialog:not([open]) {
        display: none;
    }

    dialog + .backdrop {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(0,0,0,0.5);
    }

    dialog::backdrop {
        background: rgba(0,0,0,0.5);
    }

._dialog_overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

dialog.fixed {
    position: fixed;
    top: 50%;
    transform: translate(0, -50%);
}

dialog header {
    flex: 0 0 auto;
    font-size: 14pt;
    text-align: left;
    padding: 0px;
    margin-bottom: 1em;
    background-color: transparent;
    color: #333366;
    font-weight: bold;
}

dialog main {
    flex: 1 1 auto;
    overflow: auto;
    padding: 0px;
    /*min-height: 4em;*/
    text-align: left;
    background-color: transparent;
    white-space: pre-line;
    margin-bottom: 1em;
}

dialog footer {
    flex: 0 0 auto;
    text-align: center;
    display: flex;
    justify-content: space-evenly;
    background-color: transparent;
    padding: 10px 0px;
}

    dialog header:empty,
    dialog main:empty,
    dialog footer:empty {
        display: none;
    }

    dialog footer button {
        min-width: 100px;
        padding: 5px;
    }
