@media (max-width: 565px) {
    /* message() confirm/alert overlay — fixed 650px width overflowed a phone. */
    overlay message {
        width: calc(100vw - 40px) !important;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
    }

    overlay message h2 {
        height: auto !important;
    }

    .divbody {
        height: unset !important;
    }

    h1 {
        font-size: 2.7rem !important;
        text-align: center;
        margin-bottom: -5px !important;
    }

    p {
        font-size: 1.35rem !important;
        text-align: center;
        margin-top: 15px;
    }

    #page-body {
        width: 99vw !important;
    }

        #page-body h1 {
            font-size: 3rem !important;
        }

        #page-body p {
            font-size: 1.1rem !important;
        }

        #page-body p > span:last-child {
            font-size: 0.8rem !important;
            margin-left: 0 !important;
            display: block;
        }

    #divGoededoelen {
        width: 99vw !important;
    }

        #divGoededoelen h1 {
            font-size: 2.5rem !important;
        }

        #divGoededoelen p {
            font-size: 1.1rem !important;
        }

    .goededoelen-grid {
        padding-right: 0;
    }

    .goededoelen-grid .card {
        margin-left: 10px;
        margin-right: 10px;
        height: 175px;
    }

    .divGoedDoelDetail {
        flex-direction: column;
        align-items: center;
        margin-left: 10px;
        margin-right: 10px;
    }

        .divGoedDoelDetail img {
            flex-shrink: 0;
            width: auto;
            max-width: 100%;
        }

    .voorraadbody {
        height: 89vh
    }

    #divOverOns {
        width: 99vw !important;
    }

        #divOverOns h1 {
            font-size: 2.2rem !important;
        }

        #divOverOns p {
            font-size: 1.2rem !important;
        }

    .overonscard {
        margin-top: -15px;
        text-align: center;
    }

    .login-card {
        margin-top: 20px;
    }

    #divTrooper {
        width: 99vw !important;
    }

        #divTrooper h1 {
            font-size: 2.35rem !important;
        }

        #divTrooper p {
            font-size: 1.2rem !important;
        }

        .MainDiv.Concerten {
            width:398px;
        }
            .MainDiv.Concerten h1 {
                font-size: 1.7rem !important;
                text-align: left;
                margin-bottom: -5px !important;
                width: 120px;
                margin-left: 10px;
            }
            .MainDiv.Concerten p {
                font-size: 1rem !important;
            }

    .divConcert {
        width: 392px !important;
        flex-direction: column !important;
        height: 185px !important;
    }
    #stocktelling {
        margin-left: -36px !important;
        margin-top: 98px !important;
    }
    .divConcert .titel {
        font-size:27px !important;
        width: 330px !important;
    }
    .divConcert .subtitel {
        font-size: 18px !important;
        width: 338px !important;
    }

    .divConcert .divMeer {
        position: relative !important;
        width: 370px !important;
    }

    #divBriefing {
        position: fixed;
        top: 50%;
        left: 50%;
        width: 90vw;
        height: 80vh;
        height: 80dvh;
        transform: translate(-50%, calc(-50% + 20px));
        overflow-y: auto;
        z-index: 150;
    }

        #divBriefing.show {
            transform: translate(-50%, -50%);
        }

    .divConcertDatum {
        margin: 5px -43px 10px 10px !important;
    }

    #con_ConcertPeriode {
        width: 162px !important;
    }
    
    .divConTitle {
        justify-content: space-between !important;
    }

    #c_stocktelling {
        margin-top: 100px !important;
    }

    .MainDiv.Concerten h1 {
        font-size: 1.5rem !important;
        text-align: center !important;
        width: 197px !important;
        margin-top: 29px !important;
    }

        /* ── merged from Menu.css (max-width: 565px) ── */
        .nav-toggle {
            display: flex;
        }

        nav {
            position: relative;
        }

        .nav-links-wrap {
            position: absolute;
            top: 69px;
            right: 0;
            width: 153px;
            z-index: 1000;
            display: flex;
            flex-direction: column;
        }

        .nav-links {
            display: none;
            flex-direction: column;
            gap: 0;
            position: static;
            width: 100%;
            background: var(--color-bg-card);
            border: 1px solid var(--color-border-dark);
            border-radius: 0 0 8px 8px;
            padding: 0.5rem 0;
            box-shadow: 0 8px 24px var(--color-shadow);
        }

            .nav-links:has(+ .nav-link_logout.open) {
                border-radius: 0;
                border-bottom: none;
            }

            .nav-links.open {
                display: flex;
                flex-wrap: nowrap;
                align-items: flex-end;
            }

            .nav-links li a {
                display: block;
                padding: 12px 2rem;
            }

        .nav-link_logout {
            position: static;
            width: 100%;
            border-top: none;
        }

        .nav-username {
            display: block;
            padding: 10px 1.5rem 4px;
        }

        .nav-login {
            color: var(--color-white);
            padding: 6px 16px;
            transition: background 0.2s, color 0.2s;
        }

            .nav-login:hover {
                background: var(--color-gray-900);
            }

        .nav-links a.nav-login {
            text-align: center;
        }

        .divLoginsub {
            flex-direction: column;
            width: 340px;
        }

        .MainDiv.login-card {
            width: 340px !important;
            margin-top: 100px !important;
        }

        .divLoginLogin {
            width: 340px;
            margin-left: -1px;
            border-radius: 0 0px 10px 10px;
        }

        #divcloseLogin {
            position: absolute;
            margin-left: 295px;
            margin-top: 3px;
            margin-left: 335px;
        }
        /* ── MOBIEL (max 480px) ── */
        @media (max-width: 480px) {
            nav {
                padding: 0 1rem;
            }

            .cards-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-height: 500px) {
            .divbody {
                height: unset !important;
            }

            h1 {
                font-size: 2.7rem !important;
                text-align: center;
                margin-bottom: -5px !important;
            }

            p {
                font-size: 1.35rem !important;
                text-align: center;
            }

            .voorraadbody {
                height: 89vh;
                max-width: unset;
                flex-direction: row;
            }

            #divOverOns {
                width: 99vw !important;
            }

                #divOverOns h1 {
                    font-size: 2.2rem !important;
                }

                #divOverOns p {
                    font-size: 1.2rem !important;
                }

            .overonscard {
                margin-top: -15px;
                text-align: center;
            }

            .box-grid {
                grid-template-columns: repeat(auto-fit, minmax(207px, 1fr)) !important;
            }

            .login-card {
                margin-top: 20px;
            }

            #divTrooper {
                width: 99vw !important;
            }

                #divTrooper h1 {
                    font-size: 2.35rem !important;
                }

                #divTrooper p {
                    font-size: 1.2rem !important;
                }
        }

        /* ── Inschrijvingen (mobiel portret) ──
           #divInschrijvingen (PHP) > .inschrijv-detail > #divInchrijvingen (JS,
           height 100% chained via flex so it can never outgrow its parent) >
           .in_TabRow (flex row: tab column + the active .in_Detail) + .in_ButtonRow.
           .in_Detail flex-grows to fill whatever the tab column doesn't use, so
           .in_DetailInner (width/height:100%) never has to guess a vw/vh value —
           this keeps the -1px seam against the tab column correct at any size. */
        .MainDiv.inschrijv-card {
            width: 99vw !important;
        }

            .MainDiv.inschrijv-card h1 {
                font-size: 1.7rem !important;
                text-align: left;
                margin-bottom: -5px !important;
            }

        #divInschrijvingen {
            height: 89vh !important;
            display: flex !important;
            flex-direction: column !important;
        }

            #divInschrijvingen > div:first-child {
                flex: 0 0 auto;
            }

            #divInschrijvingen .inschrijv-detail {
                flex: 1 1 auto;
                min-height: 0;
                position: relative;
            }

            #divInchrijvingen {
                height: 100% !important;
                display: flex !important;
                flex-direction: column !important;
            }

            #divInschrijvingen .in_TabRow {
                flex: 1 1 auto;
                min-height: 0;
            }

            #divInschrijvingen .tabInschr-col {
                width: 24px !important;
                flex-shrink: 0;
            }

            #divInschrijvingen .tabInschr {
                width: 24px !important;
                font-size: 0.85rem !important;
                padding-inline: 4px !important;
            }

            #divInschrijvingen .vertikaal {
                font-size: 18px !important;
            }

            #divInschrijvingen .in_Detail {
                flex: 1 1 auto;
                min-width: 0;
            }

            #divInschrijvingen .in_DetailInner {
                width: 100% !important;
                height: 100% !important;
                box-sizing: border-box;
            }

            #divInschrijvingen .in_ButtonRow {
                position: static !important;
                flex: 0 0 auto;
            }

            #divInschrijvingen .ingeschr-label {
                font-size: 13px !important;
                padding: 3px 6px !important;
            }

            #divInschrijvingen .concert {
                font-size: 1rem !important;
                height: auto !important;
                min-height: 30px !important;
                align-items: center !important;
                padding: 3px 0 !important;
            }

            #divInschrijvingen .concert img {
                width: 25px !important;
                height: 25px !important;
            }

            #divInschrijvingen .concert-icon {
                margin-left: 10px !important;
            }

    #divInschrijvingen .mobile-hint {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        margin-left: 6px;
        border: 1px solid var(--color-white);
        border-radius: 50%;
        font-size: 11px;
        line-height: 1;
        opacity: 0.7;
        cursor: pointer;
        flex-shrink: 0;
        margin-top: -25px;
        margin-left: 2px;
    }

            #divInschrijvingen .concert-date {
                width: 84px !important;
                font-size: 0.72rem !important;
                flex-shrink: 0;
            }

            #divInschrijvingen .concert-name {
                flex: 1 1 auto;
                min-width: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                margin-left: 10px !important;
            }

            #divInschrijvingen .actionButton {
                width: 29vw !important;
                height: 36px !important;
                font-size: 1rem !important;
                border-width: 1px !important;
                border-radius: 6px !important;
            }

        @media screen and (max-height: 370px) and (orientation: landscape) {
            #con_periode {
                margin-top: -30px !important;
            }

            .MainDiv.Concerten {
                width: 850px;
            }

                .MainDiv.Concerten h1 {
                    font-size: 3.5rem !important;
                    margin-bottom: -5px !important;
                }

                .MainDiv.Concerten p {
                    font-size: 1.4rem !important;
                }
        }
    }

/* ── merged from Menu.css ── */
@media (max-width: 412px) and (max-height: 915px) {
    .logo-icon {
        width: 50%;
    }

    .logo-name {
        font-size: 1rem;
        width: 80%;
        text-align: center;
    }
}

@media (max-width: 915px) and (max-height: 412px) {
    .logo-icon {
        width: 35%;
    }

    .logo-name {
        font-size: 0.8rem;
        width: 80%;
        text-align: center;
    }
}

/* ── phone landscape (width-independent, catches real device landscape widths) ── */
@media (max-height: 500px) and (orientation: landscape) {
    /* message() confirm/alert overlay — fixed 650px width overflowed a phone. */
    overlay message {
        width: calc(100vw - 40px) !important;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
    }

    #divOverOns h1 {
        font-size: 2.5rem !important;
    }

    #divOverOns p {
        font-size: 1.2rem !important;
    }

    #page-body h1 {
        font-size: 2.7rem !important;
    }

    #page-body p {
        font-size: 1.1rem !important;
        text-align: center;
    }

        #page-body p > span:last-child {
            font-size: 0.8rem !important;
            margin-left: 0 !important;
            display: block;
        }

    #page-body h1 img {
        width: 80px !important;
    }

    #page-body > div:first-child {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        margin-left: 30px;
    }

        #page-body h1 {
            flex-shrink: 0;
        }

    #page-body p {
        /*flex: 1;*/
        /*min-width: 0;*/
        width: 548px;
    }

    .cards-grid {
        margin-top: 0.5rem;
    }

    #divGoededoelen {
        width: 99vw !important;
    }

        #divGoededoelen h1 {
            font-size: 2.7rem !important;
        }

        #divGoededoelen p {
            font-size: 1.1rem !important;
        }

    #divTrooper {
        width: calc(100vw - 20px);
        margin-left: 10px;
        margin-right: 10px;
        overflow: auto;
    }

        #divTrooper h1 {
            font-size: 2.7rem !important;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top:10px;
        }

            #divTrooper h1 img {
                width: 60px !important;
                flex-shrink: 0;
            }

        #divTrooper p {
            font-size: 1.1rem !important;
        }

    .MainDiv.Concerten h1 {
        font-size: 2.7rem !important;
    }

    .MainDiv.Concerten p {
        font-size: 1.1rem !important;
    }

    .divConTitle {
        justify-content: space-between;
    }

    .MainDiv.Concerten > div:first-child {
        margin-left: 15px;
    }

    #con_ConcertPeriode {
        margin-right: 15px;
    }

    .divMeer {
        width: 432px !important;
    }

    .Ellipsis.titel {
        width: 455px !important;
    }

    #divBriefing {
        position: fixed;
        top: 57%;
        left: 50%;
        width: 90vw;
        height: 75vh;
        height: 75dvh;
        transform: translate(-50%, calc(-50% + 20px));
        overflow-y: auto;
        z-index: 150;
    }

        #divBriefing.show {
            transform: translate(-50%, -50%);
        }

    /* ── nav dropdown (not enough width in landscape for the full horizontal menu, especially when logged in) ── */
    .nav-toggle {
        display: flex;
    }

    nav {
        position: relative;
    }

    .nav-links-wrap {
        position: absolute;
        top: 69px;
        right: 0;
        width: 153px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 70px);
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0;
        position: static;
        width: 100%;
        background: var(--color-bg-card);
        border: 1px solid var(--color-border-dark);
        border-radius: 0 0 8px 8px;
        padding: 0.5rem 0;
        box-shadow: 0 8px 24px var(--color-shadow);
    }

        .nav-links:has(+ .nav-link_logout.open) {
            border-radius: 0;
            border-bottom: none;
        }

        .nav-links.open {
            display: flex;
            flex-wrap: nowrap;
            align-items: flex-end;
        }

        .nav-links li a {
            display: block;
            padding: 12px 2rem;
        }

    .nav-link_logout {
        position: static;
        width: 100%;
        border-top: none;
    }

    .nav-username {
        display: block;
        padding: 10px 1.5rem 4px;
    }

    .nav-login {
        color: var(--color-white);
        padding: 6px 16px;
        transition: background 0.2s, color 0.2s;
    }

        .nav-login:hover {
            background: var(--color-gray-900);
        }

    .nav-links a.nav-login {
        text-align: center;
    }

    #divLogin {
        max-height: calc(100vh - 70px);
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
    }

    /* ── Inschrijvingen (mobiel landschap) ──
       Same flex-chain approach as the portrait block below (see the comment
       there): #divInschrijvingen > .inschrijv-detail > #divInchrijvingen (JS)
       all size via flex/height:100%, so .in_Detail flex-grows to fill
       whatever the tab column leaves and .in_DetailInner is always exactly
       that width/height (100%) — no vw/vh guessing, no seam drift. */
    .MainDiv.inschrijv-card {
        width: calc(100vw - 20px) !important;
    }

        #inschrijvTitel {
            font-size: 1.8rem !important;
        }

    #divInschrijvingen {
        height: calc(100dvh - 90px) !important;
        display: flex !important;
        flex-direction: column !important;
    }

        #divInschrijvingen > div:first-child {
            flex: 0 0 auto;
        }

        #divInschrijvingen .inschrijv-detail {
            flex: 1 1 auto;
            min-height: 0;
            position: relative;
        }

        #divInchrijvingen {
            height: 100% !important;
            display: flex !important;
            flex-direction: column !important;
        }

        #divInschrijvingen .in_TabRow {
            flex: 1 1 auto;
            min-height: 0;
        }

        #divInschrijvingen .tabInschr-col {
            width: 24px !important;
            flex-shrink: 0;
            overflow-y: auto;
            overflow-x: hidden;
        }

        #divInschrijvingen .tabInschr {
            width: 24px !important;
            font-size: 0.85rem !important;
            padding-inline: 4px !important;
        }

        #divInschrijvingen .vertikaal {
            font-size: 16px !important;
        }

        #divInschrijvingen .in_Detail {
            flex: 1 1 auto;
            min-width: 0;
        }

        #divInschrijvingen .in_DetailInner {
            width: 100% !important;
            height: 100% !important;
            box-sizing: border-box;
        }

    #divInschrijvingen .in_ButtonRow {
        position: static !important;
        flex: 0 0 auto;
        padding: 5px 10px 0px 151px !important;
    }

        #divInschrijvingen .concert {
            font-size: 0.95rem !important;
            height: auto !important;
            min-height: 26px !important;
            align-items: center !important;
            padding: 2px 0 !important;
        }

        #divInschrijvingen .concert img {
            width: 25px !important;
            height: 25px !important;
        }

    #divInschrijvingen .mobile-hint {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        margin-left: 6px;
        border: 1px solid var(--color-white);
        border-radius: 50%;
        font-size: 11px;
        line-height: 1;
        opacity: 0.7;
        cursor: pointer;
        flex-shrink: 0;
        margin-top: -25px;
        margin-left: 2px;
    }

        #divInschrijvingen .concert-date {
            width: 90px !important;
            font-size: 0.78rem !important;
            flex-shrink: 0;
        }

        #divInschrijvingen .concert-name {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-left: 10px !important;
        }

        #divInschrijvingen .ingeschr-label {
            font-size: 12px !important;
            padding: 2px 5px !important;
        }

        #divInschrijvingen .actionButton {
            width: 106px !important;
            height: 26px !important;
            font-size: medium;
            padding: 1px !important;
        }

    /* ── Over ons popup (mobiel landschap): logo left, text to its right ── */
    #ct_about {
        width: 460px;
        max-width: calc(100vw - 20px);
    }

        #ct_about > div {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
        }

        #ct_about .ct_about_header {
            flex: 0 0 auto;
        }

            #ct_about .ct_about_header img {
                width: 200px !important;
                margin: 10px !important;
            }

        #ct_about .ct_about_text {
            flex: 1 1 0;
            height: auto !important;
            padding: 6px 10px !important;
            font-size: 18px !important;
            text-align: center !important;
        }

        #ct_about #gotoGiTaC {
            flex: 0 0 100%;
        }
}