/* ========= Grundlayout ========= */
html, body {
    margin: 0;
    padding: 0;
    background: #f4f7f6;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #222;
    overflow-x: hidden;
    height: 100%;
}

/* Footer wird nur mobil angezeigt → body bekommt "has-footer" */
@media (max-width: 768px) {
    body {
        --footer-present: 1;
    }
}
@media (min-width: 769px) {
    body {
        --footer-present: 0;
    }
}

/* --- Container --- */
main.app-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #f0f2f5;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    /* WICHTIG → sticky erlaubt */
    overflow: visible !important;
    position: relative;
}

/* Desktop */
@media (min-width: 769px) {
    main.app-container {
        margin-top: 30px;
        margin-bottom: 30px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    html, body {
        background: #f4f7f6!important;
        height: auto !important;
        overflow-y: auto !important;
        display: block;
    }

    main.app-container {
        max-width: 100%;
        margin: 0;
        padding: 14px 14px 80px 14px;
        border-radius: 0;
        box-shadow: none;
        min-height: calc(100vh - 80px);

        /* WICHTIG → sticky erlaubt */
        overflow: visible !important;
    }

    footer {
        flex-shrink: 0;
    }
}