.overlay {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    height: 100vh;
    max-height: -webkit-fill-available;
    width: 100%;
    background: transparent;
    z-index: 4010;
}

.overlay.activeOverlay {
    background-color: var(--bg-transparent-dark);
}

.modal {
    background-color: var(--background-secondary);
    width: 100%;
    max-width: 420px;
    border-radius: 2px;
    box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3);
    text-align: left;
    max-height: calc(100dvh - calc(env(safe-area-inset-top) * 2));
    overflow: auto;
}
/* guard dialog and wait-dialog from view styles */
@media (min-width: 1200px) {
    .header .title {
        --size-subheader: 16px;
    }
    .modal {
        margin-left: var(--sidebar-width-large);
    }
    .modal .contentContainer p {
        --size-default: 14px;
    }
}

.modal.small {
    max-width: 340px;
    width: 100%;
}

.modal.medium {
    /* long enough to fit a bc1... address in the receive screen on desktop */
    max-width: 520px;
    width: 100%;
}

.modal.large {
    max-width: 800px;
    width: 100%;
}

.header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 13.5px var(--space-half);
    border-bottom: solid 1px var(--background);
}

.header.centered {
    justify-content: center;
}

.header .title {
    margin: 0;
    font-size: var(--size-subheader);
    font-weight: 400;
}

.closeButton {
    background: none;
    border: none;
    padding: 0;
    width: auto !important;
}

.closeButton:focus {
    outline: none;
}

.closeButton:disabled {
    color: var(--color-secondary);
}

.header .closeButton,
.header .closeButton img {
    width: 18px;
    height: 18px;
}

.contentContainer {
    font-size: var(--size-default);
    font-weight: 400;
    padding: var(--space-half);
}

.contentContainer.slim {
    padding: 0;
}

.content p {
    word-break: break-word;
}

.actions button,
.actions a,
.small .actions button,
.small .actions a {
    width: 100%;
}

.actions > *:not(:last-child),
.small .actions > *:not(:last-child) {
    margin-bottom: var(--space-quarter);
}

.actions {
    margin-top: var(--space-quarter);
}


/* WAIT DIALOG */
.confirmationLabel {
    position: relative;
    line-height: 1.3;
    font-size: var(--size-default);
    font-weight: 400;
}

.modalContent p {
    font-size: var(--size-default);
    font-weight: 400;
}

.modalContent > *:first-child {
    margin-top: 0;
}

.detail {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-height: var(--item-height);
    padding: var(--space-half);
}

.detail:not(:first-child) {
    border-bottom: solid 1px var(--background);
}

.detail label {
    white-space: nowrap;
    margin-right: var(--space-half) !important;
}

.detail label,
.detail p {
    margin: 0;
    line-height: 1;
}

.detail.description > span {
    text-align: right;
}

.buttons {
    padding: var(--space-quarter);
}

.buttons button:first-child {
    margin-right: 10px;
}

.buttons button {
    width: 50%;
}

.dialogButtons {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    margin-top: var(--space-default);
}
.dialogButtons > *:only-child {
    width: 100%;
}

@media (min-width: 769px) {
    .closingOverlay {
        display: none;
    }
}

@media (max-width: 768px) {

    .header .title{
        font-size: var(--header-default-font-size);
    }

    .modal {
        padding: 0;
        height: auto;
        max-height: 100dvh;
    }

    .overlay {
        align-items: stretch;
        max-height: 100vh;
        padding-top: calc(var(--space-default) + env(safe-area-inset-top, 0));
    }

    .modal, .modal.small, .modal.medium, .modal.large { 
        margin-top: 0;
        max-width: 100vw;
        transform: translateY(100vh);
        transition: transform 300ms;
        border-top-right-radius: var(--space-half);
        border-top-left-radius: var(--space-half);
    }

    .modal.open {
      transition: transform 300ms;
      transform: translateY(0);
    }

    .contentContainer.slim {
        padding-bottom: calc(env(safe-area-inset-bottom, 0));
    }
}