.ssqm-wrap,
.ssqm-wrap * {
    box-sizing: border-box;
}

.ssqm-trigger {
    position: fixed;
    top: 22px;
    right: 14px;
    transform: none;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #d71920;
    color: #fff;
    cursor: pointer;
    z-index: 999992;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    animation: ssqm-pulse 1.8s infinite;
    transition: right .28s ease, transform .2s ease, background .2s ease;
}

.ssqm-trigger:hover,
.ssqm-trigger:focus-visible {
    background: #b80f15;
    transform: scale(1.06);
    outline: 3px solid rgba(215, 25, 32, .22);
    outline-offset: 3px;
}

.ssqm-trigger-lines {
    display: flex;
    width: 23px;
    flex-direction: column;
    gap: 5px;
}

.ssqm-trigger-lines span {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 4px;
    background: currentColor;
}

.ssqm-panel {
    position: fixed;
    top: 22px;
    right: 0;
    width: min(360px, calc(100vw - 28px));
    max-height: min(76vh, 650px);
    overflow: auto;
    overscroll-behavior: contain;
    transform: translateX(105%);
    background: #fff;
    border-radius: 16px 0 0 16px;
    box-shadow: -12px 12px 38px rgba(0, 0, 0, .22);
    z-index: 999991;
    opacity: 0;
    visibility: hidden;
    transition: transform .28s ease, opacity .2s ease, visibility .28s ease;
}

.ssqm-wrap.ssqm-is-open .ssqm-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.ssqm-wrap.ssqm-is-open .ssqm-trigger {
    right: min(374px, calc(100vw - 14px));
    animation: none;
}

.ssqm-panel-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 15px;
    background: #fff;
    border-bottom: 1px solid #ececec;
    z-index: 2;
}

.ssqm-title {
    font-size: 19px;
    line-height: 1.25;
    font-weight: 700;
    color: #222;
}

.ssqm-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #222;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.ssqm-nav {
    padding: 10px;
}

.ssqm-link,
.ssqm-menu-row {
    --ssqm-item-bg: #f7f7f7;
    --ssqm-item-text: #222222;
}

.ssqm-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    margin: 5px 0;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--ssqm-item-bg);
    color: var(--ssqm-item-text) !important;
    text-decoration: none !important;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    transition: transform .18s ease, box-shadow .18s ease;
}

.ssqm-link:hover,
.ssqm-link:focus-visible {
    transform: translateX(-2px);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
    outline: none;
}

.ssqm-arrow {
    color: currentColor;
    opacity: .82;
    font-size: 28px;
    line-height: 1;
}

/* Hauptpunkt mit eigenem kleinen Öffnen-/Schließen-Button fürs Untermenü. */
.ssqm-item-group {
    margin: 5px 0;
}

.ssqm-menu-row {
    display: flex;
    align-items: stretch;
    min-height: 52px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--ssqm-item-bg);
    color: var(--ssqm-item-text);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ssqm-menu-row:hover,
.ssqm-menu-row:focus-within {
    transform: translateX(-2px);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12);
}

.ssqm-menu-row .ssqm-parent-link {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    border-radius: 0;
    background: transparent;
    color: inherit !important;
    box-shadow: none;
    transform: none;
}

.ssqm-menu-row .ssqm-parent-link:hover,
.ssqm-menu-row .ssqm-parent-link:focus-visible {
    box-shadow: none;
    transform: none;
}


/* Reine Menügruppe ohne eigene WordPress-Seite: kompletter Hauptpunkt klappt nur auf/zu. */
.ssqm-group-toggle {
    width: 100%;
    padding: 0 14px;
    border: 0;
    cursor: pointer;
    justify-content: space-between;
    text-align: left;
    font: inherit;
}

.ssqm-group-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    color: inherit;
}

.ssqm-group-toggle .ssqm-submenu-arrow {
    flex: 0 0 auto;
    margin-left: 14px;
}

.ssqm-group-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}
.ssqm-submenu-toggle {
    flex: 0 0 54px;
    width: 54px;
    border: 0;
    border-left: 1px solid rgba(127, 127, 127, .25);
    background: transparent;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssqm-submenu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -4px;
}

.ssqm-submenu-arrow {
    display: inline-block;
    font-size: 25px;
    line-height: 1;
    transition: transform .18s ease;
}

.ssqm-item-group.ssqm-submenu-open .ssqm-submenu-arrow {
    transform: rotate(180deg);
}

.ssqm-submenu {
    margin: 4px 0 8px 16px;
    padding-left: 10px;
    border-left: 3px solid #e3e3e3;
}

.ssqm-submenu[hidden] {
    display: none !important;
}

.ssqm-sublink {
    min-height: 46px;
    margin: 4px 0;
    font-size: 15px;
    border-radius: 9px;
}

.ssqm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .16);
    z-index: 999990;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.ssqm-wrap.ssqm-is-open .ssqm-overlay {
    opacity: 1;
    visibility: visible;
}

@keyframes ssqm-pulse {
    0% { box-shadow: 0 0 0 0 rgba(215, 25, 32, .55), 0 6px 20px rgba(0, 0, 0, .25); }
    70% { box-shadow: 0 0 0 15px rgba(215, 25, 32, 0), 0 6px 20px rgba(0, 0, 0, .25); }
    100% { box-shadow: 0 0 0 0 rgba(215, 25, 32, 0), 0 6px 20px rgba(0, 0, 0, .25); }
}

body.admin-bar .ssqm-trigger,
body.admin-bar .ssqm-panel {
    top: 54px;
}

@media (max-width: 782px) {
    body.admin-bar .ssqm-trigger,
    body.admin-bar .ssqm-panel {
        top: 68px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ssqm-trigger {
        animation: none;
    }

    .ssqm-trigger,
    .ssqm-panel,
    .ssqm-overlay,
    .ssqm-link,
    .ssqm-menu-row,
    .ssqm-submenu-arrow {
        transition: none;
    }
}

@media (max-width: 600px) {
    .ssqm-trigger {
        right: 10px;
        width: 48px;
        height: 48px;
    }

    .ssqm-panel {
        width: min(330px, calc(100vw - 18px));
        max-height: 78vh;
    }

    .ssqm-wrap.ssqm-is-open .ssqm-trigger {
        right: calc(100vw - 57px);
    }

    .ssqm-submenu {
        margin-left: 11px;
        padding-left: 8px;
    }
}
