/*       Briefsymbol       */
#apom-rundmail-button {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 99990;
    width: 46px;
    height: 42px;
    padding: 0;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #ffffff;
    color: #94444c;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    font-family: Arial, sans-serif;
    line-height: 1;
    text-align: center;
}

#apom-rundmail-button:hover,
#apom-rundmail-button:focus {
    background: #fafafa;
    outline: none;
}

#apom-rundmail-envelope {
    display: block;
    font-size: 25px;
    line-height: 40px;
}

#apom-rundmail-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #c90000;
    color: #ffffff;
    font: bold 11px/18px Arial, sans-serif;
    text-align: center;
    box-sizing: content-box;
}

#apom-rundmail-badge[hidden] {
    display: none !important;
}

/*       Hintergrund       */
#apom-rundmail-overlay{
    position:fixed;
    inset:0;
    z-index:99999;
    display:flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    padding:22px;

    background:rgba(0,0,0,.72);

    opacity:0;
    visibility:hidden;
    transition:
        opacity .35s ease,
        visibility .35s ease;
}

#apom-rundmail-overlay.apom-open{
    opacity:1;
    visibility:visible;
}

/*       Pop-up       */
#apom-rundmail-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 680px;
    max-width: 100%;
    max-height: 90vh;
    max-height: 90svh;
    max-height: 90dvh;
    overflow: hidden;
    border: 1px solid #d7d7d7;
    border-radius: 5px;
    background: #ffffff;
    color: #555555;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
    font-family: Arial, sans-serif;
transform:translateY(18px) scale(.97);
opacity:0;

transition:
    transform .35s cubic-bezier(.2,.8,.2,1),
    opacity .35s ease;
}

#apom-rundmail-overlay.apom-open #apom-rundmail-dialog{
    transform:translateY(0) scale(1);
    opacity:1;
}

#apom-rundmail-header {
    position: relative;
    flex: 0 0 auto;
    padding: 20px 58px 17px 24px;
    border-bottom: 3px double #dddddd;
    background: #ffffff;
}

#apom-rundmail-kicker {
    display: block;
    margin-bottom: 5px;
    color: #94444c;
    font-family: Times New Roman, Times, serif;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#apom-rundmail-title {
    margin: 0;
    padding: 0;
    color: #424242;
    font-family: Times New Roman, Times, serif;
    font-size: 22px;
    font-weight: normal;
    line-height: 1.25;
    text-align: left;
    text-transform: none;
}

#apom-rundmail-meta {
    display: block;
    margin-top: 7px;
    color: #999999;
    font-size: 11px;
    line-height: 1.4;
}

#apom-rundmail-close {
    position: absolute;
    top: 10px;
    right: 13px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #777777;
    cursor: pointer;
    font: normal 30px/32px Arial, sans-serif;
}

#apom-rundmail-close:hover,
#apom-rundmail-close:focus {
    color: #94444c;
    outline: none;
}

#apom-rundmail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#apom-rundmail-content {
    padding: 0px 27px;
    color: #555555;
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

#apom-rundmail-content p {
    margin: 0 0 0px;
}

#apom-rundmail-content h1,
#apom-rundmail-content h2,
#apom-rundmail-content h3,
#apom-rundmail-content h4 {
    color: #424242;
    font-family: Times New Roman, Times, serif;
    text-align: left;
    text-transform: none;
    line-height: 1.35;
}

#apom-rundmail-content img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

#apom-rundmail-content table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
}

#apom-rundmail-content td,
#apom-rundmail-content th {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#apom-rundmail-content a {
    color: #94444c !important;
}

#apom-rundmail-loading,
#apom-rundmail-error {
    padding: 32px 27px;
    color: #777777;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

#apom-rundmail-error {
    color: #94444c;
}

#apom-rundmail-not_allowed {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 68px !important;
    padding: 14px 24px !important;
    margin: 0 !important;
    border-top: 3px double #dddddd !important;
    background: #fafafa !important;
    overflow: visible !important;
}

#apom-rundmail-read,
#apom-rundmail-archive {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 152px !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    background-image: none !important;
    font-family: "Times New Roman", Times, serif !important;
    font-size: 11px !important;
    font-weight: normal !important;
    letter-spacing: 1px !important;
    line-height: 36px !important;
    white-space: nowrap !important;
    text-align: center !important;
    text-decoration: none !important;
    text-indent: 0 !important;
    text-transform: uppercase !important;
    vertical-align: middle !important;
    opacity: 1 !important;
    overflow: visible !important;
}

#apom-rundmail-read {
    border: 1px solid #94444c !important;
    background-color: #94444c !important;
    color: #ffffff !important;
    cursor: pointer !important;
}

#apom-rundmail-archive {
    border: 1px solid #cccccc !important;
    background-color: #ffffff !important;
    color: #666666 !important;
    cursor: pointer !important;
}

#apom-rundmail-read:hover,
#apom-rundmail-read:focus {
    border-color: #7f3541 !important;
    background-color: #7f3541 !important;
    color: #ffffff !important;
    opacity: 1 !important;
    outline: none !important;
    text-shadow: none !important;
}

#apom-rundmail-archive:hover,
#apom-rundmail-archive:focus {
    border-color: #94444c !important;
    background-color: #ffffff !important;
    color: #94444c !important;
    opacity: 1 !important;
    outline: none !important;
    text-shadow: none !important;
}

html.apom-rundmail-lock,
body.apom-rundmail-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/*       Smartphone / iPhone / Safari       */
@media screen and (max-width: 700px) {
    #apom-rundmail-button {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
    }

    #apom-rundmail-overlay {
        align-items: center;
        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    #apom-rundmail-dialog {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 16px);
        max-height: calc(100svh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 6px;
    }

    #apom-rundmail-header {
        padding: 16px 50px 14px 18px;
    }

    #apom-rundmail-title {
        font-size: 19px;
        line-height: 1.25;
    }

    #apom-rundmail-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    #apom-rundmail-content {
        padding: 18px;
        font-size: 14px;
        line-height: 1.65;
    }

    #apom-rundmail-content img,
    #apom-rundmail-content video,
    #apom-rundmail-content iframe {
        max-width: 100% !important;
        height: auto !important;
    }

    #apom-rundmail-not_allowed {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding:
            12px
            18px
            max(12px, env(safe-area-inset-bottom)) !important;
    }

    #apom-rundmail-read,
    #apom-rundmail-archive {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 42px !important;
        height: 42px !important;
        line-height: 40px !important;
    }
}

/* Sehr kleine Displays und Querformat */
@media screen and (max-height: 520px) {
    #apom-rundmail-overlay {
        align-items: stretch;
        padding: 6px;
    }

    #apom-rundmail-dialog {
        max-height: calc(100vh - 12px);
        max-height: calc(100svh - 12px);
        max-height: calc(100dvh - 12px);
    }

    #apom-rundmail-header {
        padding-top: 10px;
        padding-bottom: 9px;
    }

    #apom-rundmail-not_allowed {
        flex-direction: row !important;
        padding: 8px 12px !important;
    }
}

/*       Rundmail-Seiten / Blätter-Navigation       */
#apom-rundmail-pager {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 43px;
    padding: 7px 24px 6px;
    border-top: 1px solid #e4e4e4;
    background: #ffffff;
    box-sizing: border-box;
}

#apom-rundmail-pager[hidden] {
    display: none !important;
}

#apom-rundmail-prev,
#apom-rundmail-next {
    width: 34px;
    height: 30px;
    padding: 0;
    border: 1px solid #d4d4d4;
    border-radius: 2px;
    background: #ffffff;
    color: #94444c;
    cursor: pointer;
    font: normal 24px/26px "Times New Roman", Times, serif;
    text-align: center;
}

#apom-rundmail-prev:hover:not(:disabled),
#apom-rundmail-next:hover:not(:disabled),
#apom-rundmail-prev:focus:not(:disabled),
#apom-rundmail-next:focus:not(:disabled) {
    border-color: #94444c;
    outline: none;
}

#apom-rundmail-prev:disabled,
#apom-rundmail-next:disabled {
    color: #c9c9c9;
    border-color: #e7e7e7;
    cursor: default;
}

#apom-rundmail-page {
    min-width: 112px;
    color: #777777;
    font-family: "Times New Roman", Times, serif;
    font-size: 10px;
    font-weight: normal;
    letter-spacing: 1.5px;
    line-height: 1;
    text-align: center;
}

#apom-rundmail-read:disabled {
    border-color: #bbbbbb !important;
    background-color: #bbbbbb !important;
    cursor: default !important;
}

@media screen and (max-width: 700px) {
    #apom-rundmail-pager {
        gap: 14px;
        padding: 7px 18px 6px;
    }
}
