div.sidebar-wrapper {
    pointer-events: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    right: MIN(1%, 20px);
    z-index: 400;
}

div.sidebar-wrapper.modal-open,
div.sidebar-wrapper.ssn-opening-hours-open {
    z-index: 9998;
}

aside.sidebar.fixed {
    pointer-events: auto;
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    z-index: 400;
    background: none;
    border: none;
    transition: opacity .3s ease;
}

@media (max-width: 640px) and (max-height: 700px) {
    aside.sidebar.fixed {
        bottom: 10%;
        transform: none;
    }
}

.ssn-sidebar__inner {
    position: relative;
    display: flex;
    align-items: flex-end;
}

.ssn-sidebar__stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    position: relative;
}

/* Kontakt (original layout + Landhaus styling) */
aside.sidebar.fixed .stickyElement {
    position: relative;
    right: auto;
    bottom: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 10px 20px;
    background-color: #fde39d;
    border: 0;
    border-radius: 999px;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, .1);
    transition: border-radius .12s ease, padding .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s ease;
}

@media (max-width: 640px) and (max-height: 700px) {
    aside.sidebar.fixed .stickyElement {
        padding: 10px 10px 20px;
    }
}

aside.sidebar.fixed .stickyElement .head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

aside.sidebar.fixed .stickyElement .head .image {
    border-radius: 50%;
    overflow: hidden;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

aside.sidebar.fixed .stickyElement .head .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

aside.sidebar.fixed .stickyElement .head .title {
    display: none;
    font-family: var(--font-family-paragraph, Poppins, sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 27px;
    color: #395b4a;
}

aside.sidebar.fixed .stickyElement .head .title.hidden {
    display: none;
}

aside.sidebar.fixed .stickyElement .stickyElement__label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 77px;
    font-family: var(--font-family-paragraph, Poppins, sans-serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #395b4a;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    user-select: none;
}

aside.sidebar.fixed .stickyElement .options {
    display: none;
    flex-direction: column;
    gap: 12px;
}

aside.sidebar.fixed .stickyElement .options .option {
    align-items: center;
    display: flex;
    gap: 16px;
}

aside.sidebar.fixed .stickyElement .options .option.wysiwyg {
    min-width: 300px;
    display: block;
    padding: 15px;
}

aside.sidebar.fixed .stickyElement .options .option > a {
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #395b4a;
    font-family: var(--font-family-paragraph, Poppins, sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 27px;
    transition: color .3s ease-in-out;
}

aside.sidebar.fixed .stickyElement .options .option > a:hover {
    color: #152d22;
}

aside.sidebar.fixed .stickyElement .options .option .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 12px;
    border: 1px solid #aab8a9;
    border-radius: 999px;
    flex-shrink: 0;
}

aside.sidebar.fixed .stickyElement .options .option .icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

aside.sidebar.fixed .stickyElement .options .option .link.hidden {
    display: none;
}

aside.sidebar.fixed .stickyElement .options .option.divider {
    display: none;
}

aside.sidebar.fixed .stickyElement .options .option.hidden {
    display: none;
}

aside.sidebar.fixed .stickyElement:hover,
aside.sidebar.fixed .stickyElement:focus-within {
    border-radius: 16px;
    padding: 16px;
    gap: 16px;
}

/* Keyboard focus ring on the contact element itself */
aside.sidebar.fixed .stickyElement:focus-visible {
    outline: 2px solid var(--mainColor, #395b4a);
    outline-offset: 3px;
}

@media (max-width: 640px) and (max-height: 700px) {
    aside.sidebar.fixed .stickyElement:hover,
    aside.sidebar.fixed .stickyElement:focus-within {
        position: absolute;
        bottom: 0;
        right: 0;
    }
}

aside.sidebar.fixed .stickyElement:hover .head,
aside.sidebar.fixed .stickyElement:focus-within .head {
    flex-direction: row;
    align-items: center;
}

aside.sidebar.fixed .stickyElement:hover .stickyElement__label,
aside.sidebar.fixed .stickyElement:focus-within .stickyElement__label {
    display: none;
}

aside.sidebar.fixed .stickyElement:hover .head .title.hidden,
aside.sidebar.fixed .stickyElement:focus-within .head .title.hidden {
    display: block;
}

aside.sidebar.fixed .stickyElement:hover .options,
aside.sidebar.fixed .stickyElement:focus-within .options {
    display: flex;
}

aside.sidebar.fixed .stickyElement:hover .options .option.hidden:not(.divider),
aside.sidebar.fixed .stickyElement:focus-within .options .option.hidden:not(.divider) {
    display: flex;
}

aside.sidebar.fixed .stickyElement:hover .options .option.hidden.wysiwyg,
aside.sidebar.fixed .stickyElement:focus-within .options .option.hidden.wysiwyg {
    display: block;
}

aside.sidebar.fixed .stickyElement:hover .options .option .link.hidden,
aside.sidebar.fixed .stickyElement:focus-within .options .option .link.hidden {
    display: block;
}

/* Öffnungszeiten-Panel */
.ssn-opening-hours {
    position: absolute;
    right: calc(100% + 20px);
    top: 0;
    width: min(451px, calc(100vw - 120px));
    background: #dde3dd;
    border: 1px solid #395b4a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, .1);
}

.ssn-opening-hours__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding: 16px;
    background: #395b4a;
    color: #fff;
}

.ssn-opening-hours__head-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ssn-opening-hours__head-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    color: #fff;
}

.ssn-opening-hours__head-icon img,
.ssn-opening-hours__head-icon .ssn-opening-hours-trigger__icon img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.ssn-opening-hours__head-icon .ssn-opening-hours-trigger__icon--default svg {
    display: block;
    width: 25px;
    height: 25px;
}

.ssn-opening-hours__headline {
    margin: 0;
    font-family: var(--font-family-paragraph, Poppins, sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 27px;
    color: #fff;
}

.ssn-opening-hours__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.ssn-opening-hours__close:hover,
.ssn-opening-hours__close:focus-visible {
    background: rgba(255, 255, 255, .12);
    outline: none;
}

.ssn-opening-hours__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    color: #152d22;
    font-family: var(--font-family-paragraph, Poppins, sans-serif);
    font-size: 16px;
    line-height: 27px;
    max-height: min(70vh, 640px);
    overflow-y: auto;
}

.ssn-opening-hours__section--text > :last-child {
    margin-bottom: 0;
}

.ssn-opening-hours__body p:not(:first-child) {
    margin-top: 20px!important;
}

.ssn-opening-hours__body p.minitext {
    margin-top: 7px!important;
}

.ssn-opening-hours__body p:last-child {
    margin-bottom: 0;
}

.ssn-opening-hours__body strong,
.ssn-opening-hours__body b,
.ssn-opening-hours__body h3,
.ssn-opening-hours__body h4 {
    color: #395b4a;
    font-weight: 500;
}

.ssn-opening-hours__body em,
.ssn-opening-hours__body i,
.ssn-opening-hours__body .minitext {
    color: #395b4a;
    font-size: 12px;
    font-style: italic;
    line-height: 16px;
}

.ssn-opening-hours__body .minitext {
    margin: 0;
}

.ssn-opening-hours__body table {
    width: 100%;
    border-collapse: collapse;
}

.ssn-opening-hours__body td,
.ssn-opening-hours__body th {
    padding: 10px 0;
    border-bottom: 1px solid #aab8a9;
    vertical-align: top;
}

.ssn-deer-schedule__title {
    margin: 0;
    color: #395b4a;
    font-weight: 500;
}

.ssn-deer-schedule__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #aab8a9;
}


.ssn-deer-schedule__row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    color: #152d22;
}

.ssn-deer-schedule__date {
    min-width: 0;
}

.ssn-deer-schedule__time {
    min-width: 0;
}

.ssn-deer-schedule__status {
    text-align: right;
    white-space: nowrap;
}

.ssn-deer-schedule__row--continuation .ssn-deer-schedule__date {
    visibility: hidden;
}

/* Uhr-Button */
.ssn-opening-hours-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}

.ssn-opening-hours-trigger__inner {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* fills the 70px hit area so the circle matches the accessibility toolbar
       button sitting next to it (a 70px solid circle) */
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #395b4a;
    color: #fff;
}

.ssn-opening-hours-trigger__ring {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 1px dashed #fde39d;
    background: transparent;
    pointer-events: none;
    z-index: 0;
}

.ssn-opening-hours-trigger__icon {
    position: relative;
    z-index: 1;
    width: 25px;
    height: 25px;
}

.ssn-opening-hours-trigger__icon img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.ssn-opening-hours-trigger__icon--default svg {
    display: block;
    width: 25px;
    height: 25px;
}

/* the accessibility toolbar drops its button from 70px to 56px at 768px —
   follow it so the two circles stay the same size at every width */
@media (max-width: 768px) {
    .ssn-opening-hours-trigger,
    .ssn-opening-hours-trigger__inner {
        width: 56px;
        height: 56px;
    }
}

.ssn-opening-hours-trigger:hover .ssn-opening-hours-trigger__inner,
.ssn-opening-hours-trigger:focus-visible .ssn-opening-hours-trigger__inner {
    background: #1d4332;
}

.ssn-opening-hours-trigger:focus-visible {
    outline: 3px solid #395b4a;
    outline-offset: 3px;
}

.ssn-opening-hours-trigger[aria-expanded="true"] .ssn-opening-hours-trigger__inner {
    background: #1d4332;
}

div.sidebar-wrapper.scroll-hide:not(.modal-open):not(.ssn-opening-hours-open) aside.sidebar.fixed:not(:has(.stickyElement:hover)):not(:has(.stickyElement:focus-within)) .ssn-sidebar__stack {
    transform: translateX(calc(98% + 10px));
    transition: transform .3s ease;
}

/* ==========================================================================
   Header-Modus: Icon im Header + Modal-Darstellung
   ========================================================================== */

.ssn-header-trigger {
    width: 40px;
    height: 40px;
    padding: 6px;
    border: 1px solid #fffc;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, .1);
    transition: box-shadow .2s ease, outline-offset .15s ease;
}

.ssn-header-trigger:focus {
    outline: none;
}

.ssn-header-trigger:focus-visible {
    outline: 3px solid var(--mainColor, #2271b1);
    outline-offset: 3px;
}

.ssn-header-trigger img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.ssn-header-trigger:hover {
    box-shadow: -4px 4px 16px rgba(0, 0, 0, .18);
}

@media (max-width: 1200px) {
    .ssn-header-trigger.in-header {
        display: flex;
        position: relative;
        margin-left: auto;
        align-self: center;
        flex-shrink: 0;
        pointer-events: auto;
    }

    .ssn-header-trigger.floating {
        display: flex;
        position: fixed;
        top: 15px;
        right: 15px;
        width: 48px;
        height: 48px;
        padding: 8px;
        z-index: 9997;
        pointer-events: auto;
    }

    div.sidebar-wrapper.has-header-mode:not(.modal-open) aside.sidebar.fixed {
        display: none;
    }
}

.ssn-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, .45);
    z-index: 9996;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

div.sidebar-wrapper.modal-open .ssn-modal-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.ssn-modal-close {
    pointer-events: auto;
    position: fixed;
    top: 15px;
    right: 15px;
    width: 48px;
    height: 48px;
    border: 1px solid #fffc;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    color: #333;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, .1);
    transition: box-shadow .2s ease;
}

.ssn-modal-close span {
    display: block;
    margin-top: -3px;
}

.ssn-modal-close:hover {
    box-shadow: -4px 4px 16px rgba(0, 0, 0, .18);
}

.ssn-modal-close:focus {
    outline: none;
}

.ssn-modal-close:focus-visible {
    outline: 3px solid var(--mainColor, #2271b1);
    outline-offset: 3px;
}

div.sidebar-wrapper aside.sidebar.fixed .stickyElement a:focus {
    outline: none;
}

div.sidebar-wrapper aside.sidebar.fixed .stickyElement a:focus-visible {
    outline: 2px solid var(--mainColor, #395b4a);
    outline-offset: 3px;
    border-radius: 4px;
}

div.sidebar-wrapper.modal-open .ssn-modal-close {
    display: flex;
}

div.sidebar-wrapper.modal-open aside.sidebar.fixed {
    pointer-events: auto;
    opacity: 1;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: none;
    z-index: 9998;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 80px 15px 15px 15px;
}

div.sidebar-wrapper.modal-open aside.sidebar.fixed .stickyElement {
    position: relative;
    right: auto;
    bottom: auto;
    transform: none;
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: auto;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    animation: ssnModalIn .3s cubic-bezier(.4, 0, .2, 1);
}

div.sidebar-wrapper.modal-open .stickyElement .stickyElement__label {
    display: none;
}

div.sidebar-wrapper.modal-open .stickyElement .head .title.hidden,
div.sidebar-wrapper.modal-open .stickyElement .options .option.hidden:not(.divider),
div.sidebar-wrapper.modal-open .stickyElement .options .option .link.hidden {
    display: flex;
    align-items: center;
}

div.sidebar-wrapper.modal-open .stickyElement .head .title.hidden {
    display: block;
}

div.sidebar-wrapper.modal-open .stickyElement .options .option.wysiwyg.hidden {
    display: block;
}

div.sidebar-wrapper.modal-open .stickyElement .options {
    display: flex;
}

div.sidebar-wrapper.modal-open .stickyElement .head {
    flex-direction: row;
    align-items: center;
}

@keyframes ssnModalIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .ssn-opening-hours {
        right: 0;
        bottom: calc(100% + 12px);
        width: min(100vw - 30px, 451px);
    }

    div.sidebar-wrapper.modal-open aside.sidebar.fixed {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }

    div.sidebar-wrapper.modal-open aside.sidebar.fixed .ssn-sidebar__inner {
        max-width: 100%;
        width: 100%;
        max-height: 100vh;
        border-radius: 0 0 24px 24px;
        /* the accessibility toolbar button is fixed 20px from the bottom right
           with a higher z-index than this modal (9999 vs 9998), so it covers
           the bottom of the panel — clear it with 20px offset + 56px button
           (its size below 768px) + a 20px gap */
        padding: 70px 20px 96px 20px;
        animation: ssnModalSlideDown .35s cubic-bezier(.4, 0, .2, 1);
    }

    /* the card is capped at calc(100vh - 110px) above, which assumed the old
       24px bottom padding and would grow straight back under the button — let
       it shrink to whatever the stack leaves and scroll instead, so it stays
       correct with or without the clock button below it */
    div.sidebar-wrapper.modal-open aside.sidebar.fixed .ssn-sidebar__stack {
        max-height: 100%;
    }

    div.sidebar-wrapper.modal-open aside.sidebar.fixed .stickyElement {
        max-height: none;
        min-height: 0;
    }

    @keyframes ssnModalSlideDown {
        from {
            opacity: 0;
            transform: translateY(-100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
