/* Use the native details controls throughout, including with a hardware keyboard. */
@media screen and (forced-colors: none) and (prefers-contrast: no-preference) {
    /* Keep the masthead at its scroll opacity while an opaque link panel is open. */
    html:not(.rhg-kontrast) #page-container #main-content .rk-header.rk-kopf-blende:has(.rs-desktop details[open], .rs-mobilemenu[open]) {
        --rk-kopf-flaeche: var(--rk-kopf-deckung, 1);
    }
}
@media screen {
    #page-container #main-content .rs-mobilemenu > summary {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .6em;
        min-height: 44px;
        padding-inline: .75rem !important;
        list-style: none;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
    }
    #page-container .rs-mobilemenu summary::-webkit-details-marker { display: none; }
    #page-container #main-content .rs-mobilemenu > summary::after {
        content: "";
        flex: none;
        width: 16px;
        height: 16px;
        background-color: currentColor;
        --rsr-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
        -webkit-mask: var(--rsr-symbol) center / contain no-repeat;
        mask: var(--rsr-symbol) center / contain no-repeat;
    }
    #page-container #main-content .rs-mobilemenu[open] > summary::after {
        --rsr-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 5 14 14M19 5 5 19' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    }
    #page-container #main-content .rs-mobilemenu > summary:active,
    #page-container #main-content .rs-mobilemenu[open] > summary {
        border-color: currentColor;
    }
    #page-container #main-content .rs-mobilemenu > summary:focus:not(:focus-visible) {
        outline: none !important;
        box-shadow: none !important;
    }
    #page-container #main-content .rs-mobilemenu > summary:focus-visible,
    #page-container #main-content .rs-mobile-panel :is(a,button,summary):focus-visible {
        outline: 2px solid currentColor !important;
        outline-offset: -4px !important;
        box-shadow: none !important;
    }

    #page-container #main-content .rs-mobile-panel :is(a,summary):not(.rsr-menueaktionen *) {
        box-sizing: border-box;
        display: flex !important;
        align-items: center;
        width: 100%;
        min-height: 44px;
        padding: .55rem .8rem !important;
        line-height: 1.4;
        text-decoration: none !important;
    }
    #page-container #main-content .rs-mobile-panel details a:not(.rsr-menueaktionen *) { padding-inline-start: 1.6rem !important; }
    #page-container #main-content .rs-mobile-panel summary {
        justify-content: space-between;
        list-style: none;
    }
    #page-container #main-content .rs-mobile-panel summary::after {
        content: "";
        width: .45em;
        height: .45em;
        flex: none;
        margin-inline: .6em .2em;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        transform: rotate(45deg);
    }
    #page-container #main-content .rs-mobile-panel details[open] > summary::after {
        transform: rotate(225deg);
    }

    /* Draw the existing decorative arrow so iOS never substitutes its blue emoji tile. */
    #main-content .rs-card-link > span[aria-hidden="true"] {
        display: inline-block;
        flex: none;
        align-self: center;
        width: 15px;
        height: 15px;
        font-size: 0 !important;
        background-color: currentColor;
        --rsr-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 16 16 4M5 4h11v11' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
        -webkit-mask: var(--rsr-symbol) center / contain no-repeat;
        mask: var(--rsr-symbol) center / contain no-repeat;
    }
    #main-content .rs-card-link > span[aria-hidden="true"] > img { display: none !important; }

    .page-id-85013 #main-content .rs-person a.rs-person-email[href^="mailto:" i],
    #main-content .rsr-personkarte a[href^="mailto:" i] {
        display: inline-flex;
        align-items: center;
        gap: .5em;
        max-width: 100%;
        min-height: 44px;
        overflow-wrap: anywhere;
    }
    .page-id-85013 #main-content .rs-person a.rs-person-email[href^="mailto:" i]::before,
    #main-content .rsr-personkarte a[href^="mailto:" i]::before {
        content: "";
        flex: 0 0 1.2em;
        height: 1.2em;
        background-color: currentColor;
        --rsr-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='2.5' y='4.5' width='19' height='15' rx='2'/%3E%3Cpath d='m3.5 6 8.5 6.5L20.5 6'/%3E%3C/svg%3E");
        -webkit-mask: var(--rsr-symbol) center / contain no-repeat;
        mask: var(--rsr-symbol) center / contain no-repeat;
    }
}

@media screen and (max-width: 980px) {
    #main-content .wb-wegweiser > div {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: flex;
        flex-flow: row nowrap;
        justify-content: flex-start;
        gap: clamp(1rem, 3vw, 1.75rem);
        padding-inline: max(5%, env(safe-area-inset-left)) max(5%, env(safe-area-inset-right));
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-padding-inline: 5%;
    }
    #main-content .wb-wegweiser > div > a {
        flex: none;
        min-height: 48px;
        white-space: nowrap;
    }
    #main-content .wb-wegweiser a:focus-visible {
        outline-offset: -3px;
    }
}

@media (forced-colors: active) {
    #page-container .rs-mobilemenu > summary::after,
    #main-content .rs-card-link > span[aria-hidden="true"],
    .page-id-85013 #main-content .rs-person a.rs-person-email::before {
        forced-color-adjust: none;
        color: LinkText;
    }
}
