/* ── Ergonomie-Check ────────────────────────────────────── */

/* ── Zwei-Spalten-Layout ── */

.ergo-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    max-width: 1100px;
    padding: 0 2rem;
    box-sizing: border-box;
    margin-top: 5rem;
    padding-bottom: 8rem;
}

/* ── Links: Checkpunkte ── */

.ergo-content {
    flex: 1;
    min-width: 0;
    padding-right: 5rem;
}

/* ── Rechts: Mobiliar-Sidebar ── */

.ergo-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 13rem;
    align-self: flex-start;
    border-left: 2px solid #e0ddd5;
    padding-left: 4rem;
    padding-top: 5.5rem;
    padding-bottom: 4rem;
}

.ergo-sidebar[hidden] {
    display: none !important;
}

.ergo-sidebar-label {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #02203c;
    opacity: 0.45;
    margin-bottom: 2.4rem;
}

.ergo-furniture-item {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    margin-bottom: 2rem;
}

.ergo-furniture-item:last-child {
    margin-bottom: 0;
}

.ergo-furniture-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e6f4e6;
    border-radius: 12px;
    color: #2C862B;
}

.ergo-furniture-icon svg {
    width: 32px;
    height: 32px;
}

.ergo-furniture-name {
    font-size: 1.55rem;
    color: #02203c;
    line-height: 1.35;
    font-weight: 500;
}

.ergo-furniture-none {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.ergo-furniture-none i {
    font-size: 3.4rem;
    color: #2C862B;
}

.ergo-furniture-none-text {
    font-size: 1.6rem;
    color: #2C862B;
    font-weight: 600;
}

/* ── Action Items ── */

#actionItems:empty {
    display: none;
}

#actionItems:not(:empty) {
    margin-top: 2.8rem;
    padding-top: 2.4rem;
    border-top: 2px solid #e0ddd5;
}

@media (max-width: 900px) {
    #actionItems:not(:empty) {
        margin-top: 0;
    }
}

.ergo-action-label {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #02203c;
    opacity: 0.45;
    margin-bottom: 1.2rem;
}

.ergo-action-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ergo-action-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: 1.45rem;
    color: #02203c;
    line-height: 1.45;
}

.ergo-action-item::before {
    content: '→';
    color: #2C862B;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05em;
}

.ergo-action-tip {
    margin-top: 1.6rem;
    font-size: 1.3rem;
    color: #02203c;
    opacity: 0.55;
    line-height: 1.65;
    padding: 1.2rem 1.4rem;
    background: #f7f6f1;
    border-radius: 10px;
}

.ergo-action-tip strong {
    color: #02203c;
    opacity: 1;
    font-weight: 700;
}

/* ── Slider ── */

.ergo-slider-wrapper {
    overflow: hidden;
    width: 100%;
}

.ergo-slider {
    display: flex;
    align-items: flex-start;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.ergo-step {
    width: 100%;
    flex-shrink: 0;
}

/* ── Section ── */

.ergo-section {
    counter-reset: ergo-item;
}

.ergo-section-title {
    font-size: clamp(1.8rem, 2.4vw, 2.2rem) !important;
    font-weight: 700 !important;
    color: #02203c !important;
    margin: 0 0 1.6rem !important;
    padding-bottom: 1.2rem !important;
    border-bottom: 2px solid #e0ddd5 !important;
    letter-spacing: 0.04em;
}

/* ── Checkpoint card ── */

.ergo-cp {
    background: #fff;
    border-radius: 14px;
    padding: 1.4rem 2rem;
    margin-bottom: 0.8rem;
    box-shadow: 0 1px 5px rgba(2, 32, 60, 0.07);
    transition: box-shadow 0.2s ease;
    counter-increment: ergo-item;
}

.ergo-cp:hover {
    box-shadow: 0 3px 12px rgba(2, 32, 60, 0.1);
}

/* ── Item row ── */

.ergo-cp-row {
    display: flex;
    align-items: flex-start;
    gap: 1.4rem;
}

/* ── Number ── */

.ergo-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e6f4e6;
    color: #2C862B;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    letter-spacing: 0;
}

.ergo-num::before {
    content: counter(ergo-item);
}

.ergo-cp-text {
    font-size: 1.5rem;
    line-height: 1.55;
    color: #02203c;
    flex: 1;
}

.ergo-cp-text::after {
    content: '.';
}

/* ── Warum? details/summary ── */

.ergo-warum {
    margin-top: 1.1rem;
    padding-left: calc(26px + 1.4rem);
}

.ergo-warum summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2C862B;
    letter-spacing: 0.04em;
    user-select: none;
    outline: none;
}

.ergo-warum summary::-webkit-details-marker {
    display: none;
}

.ergo-caret {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
    display: inline-block;
}

.ergo-warum[open] .ergo-caret {
    transform: rotate(180deg);
}

.ergo-warum p {
    margin-top: 0.9rem;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #02203c;
    opacity: 0.72;
}

/* ── Content tip ── */

.ergo-content-tip {
    margin-top: 1.4rem;
    font-size: 1.35rem;
    color: #02203c;
    opacity: 0.6;
    line-height: 1.65;
    padding: 1.2rem 1.4rem;
    background: #f7f6f1;
    border-radius: 10px;
}

/* ── Weiter button ── */

.ergo-next-wrapper {
    display: flex;
    gap: 1.2rem;
    margin-top: 2.4rem;
}

/* ── Responsive: unter 900px einspaltiges Layout ── */

@media (max-width: 900px) {
    .ergo-layout {
        flex-direction: column;
    }

    .ergo-content {
        padding-right: 0;
        width: 100%;
    }

    .ergo-sidebar {
        width: 100%;
        position: static;
        border-left: none;
        border-top: 2px solid #e0ddd5;
        padding-left: 0;
        padding-top: 3rem;
        margin-top: 4rem;
        display: flex;
        flex-wrap: wrap;
        gap: 3.5rem;
        align-items: center;
    }

    .ergo-sidebar-label {
        width: 100%;
        margin-bottom: 0;
    }

    .ergo-furniture-item {
        margin-bottom: 2rem;
    }

    #furnitureItems,
    #actionItems {
        width: 100%;
    }

    .ergo-sidebar {
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    .ergo-layout {
        padding: 0 1.5rem;
    }
}

/* ── Modal ── */

.ergo-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(2, 32, 60, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.ergo-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ergo-modal {
    background: #fff;
    border-radius: 20px;
    width: min(980px, 94vw);
    max-height: 96vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 64px rgba(2, 32, 60, 0.22);
    transform: translateY(14px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ergo-modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ergo-modal-footer {
    display: flex;
    gap: 1.2rem;
    padding: 1.6rem 3rem;
    border-top: 2px solid #e0ddd5;
    background: #fff;
    flex-shrink: 0;
}

.ergo-modal-footer[hidden] {
    display: none;
}

.ergo-modal-backdrop.is-open .ergo-modal {
    transform: translateY(0);
}

.ergo-close-btn {
    position: absolute;
    top: 1.8rem;
    right: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #02203c;
    opacity: 0.35;
    padding: 0.4rem;
    line-height: 1;
    z-index: 10;
    transition: opacity 0.15s ease;
}

.ergo-close-btn i {
    font-size: 2.2rem;
    display: block;
}

.ergo-close-btn:hover {
    opacity: 0.75;
}

/* ── Modal layout overrides ── */

.ergo-modal .ergo-layout {
    margin-top: 0;
    padding: 2rem 3rem 2.5rem;
}

.ergo-modal .ergo-sidebar {
    top: 2rem;
}

/* ── Step 0: Intro ── */

.ergo-step--intro {
    display: flex;
    align-items: center;
    gap: 5rem;
    padding: 4rem 0;
    min-height: 300px;
}

.ergo-intro-img {
    width: clamp(140px, 18vw, 200px);
    flex-shrink: 0;
}

.ergo-intro-img--large {
    width: clamp(180px, 24vw, 280px);
}

.ergo-intro-text {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.ergo-intro-title {
    font-size: clamp(2rem, 2.6vw, 2.6rem) !important;
    font-weight: 500 !important;
    color: #02203c !important;
    line-height: 1.3 !important;
    margin: 0 !important;
}

.ergo-intro-disclaimer {
    font-size: 1.5rem;
    color: #02203c;
    opacity: 0.45;
    margin: 0;
    letter-spacing: 0.03em;
    line-height: 1.7;
    text-align: left;
}

#ergoStart {
    align-self: flex-start;
}

.ergo-outro-text {
    font-size: 1.5rem;
    color: #02203c;
    opacity: 0.7;
    line-height: 1.6;
    margin: 0;
}

.ergo-outro-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ergo-outro-links a {
    font-size: 1.45rem;
    color: #2C862B;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}

.ergo-outro-links a:hover {
    color: #236e22;
}

@media (max-width: 700px) {
    .ergo-step--intro {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
        padding: 2rem 0;
    }

    #ergoStart {
        align-self: center;
    }
}

@media (max-width: 600px) {
    /* Modal: slide up from bottom as a sheet */
    .ergo-modal-backdrop {
        align-items: flex-end;
    }

    .ergo-modal {
        width: 100vw;
        max-height: 92dvh;
        border-radius: 20px 20px 0 0;
    }

    /* Reduce inner padding */
    .ergo-modal .ergo-layout {
        padding: 1.6rem 2.4rem 2rem;
    }

    .ergo-modal-footer {
        padding: 1.2rem 2.4rem;
        flex-direction: column;
        gap: 0.8rem;
    }

    .ergo-modal-footer .secondary-btn,
    .ergo-modal-footer .primary-btn {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    /* Tighten checkpoint cards */
    .ergo-cp {
        padding: 1.2rem 1.4rem;
    }

    /* Remove forced min-height and padding on intro so it doesn't scroll */
    .ergo-step--intro {
        min-height: 0;
        padding: 1rem 0;
    }

    /* Prevent intro image from being too large */
    .ergo-intro-img {
        width: clamp(80px, 28vw, 120px);
    }

    .ergo-intro-img--large {
        width: clamp(160px, 50vw, 220px);
    }
}
