
/* ERP PWA / Mobile – gemeinsame Basis für alle Instanzen */

html{
    min-height:100%;
    background:var(--hw-neutral,#f7f7f7);
}

body{
    min-height:100dvh;
    -webkit-text-size-adjust:100%;
    -webkit-tap-highlight-color:transparent;
    overscroll-behavior-y:none;
}

.topbar{
    padding-top:env(safe-area-inset-top);
}

body.is-standalone .topbar{
    position:sticky;
    top:0;
    z-index:100;
}

main.container,
main.auth-shell{
    padding-left:max(16px,env(safe-area-inset-left));
    padding-right:max(16px,env(safe-area-inset-right));
    padding-bottom:max(24px,env(safe-area-inset-bottom));
}

button,
.btn,
.ghost-button,
input,
select,
textarea{
    touch-action:manipulation;
}

@media (max-width: 760px){
    input,
    select,
    textarea{
        font-size:16px !important; /* verhindert Auto-Zoom auf iPhone */
    }

    button,
    .btn,
    .ghost-button,
    .main-nav a{
        min-height:44px;
    }

    .topbar-inner{
        padding-left:max(12px,env(safe-area-inset-left));
        padding-right:max(12px,env(safe-area-inset-right));
    }

    .main-nav.is-open{
        max-height:calc(100dvh - 72px - env(safe-area-inset-top));
        overflow-y:auto;
        -webkit-overflow-scrolling:touch;
    }

    .page-header{
        gap:12px;
    }

    .page-header.row-between,
    .form-actions.row-between{
        align-items:stretch;
        flex-direction:column;
    }

    .form-actions .btn,
    .page-header .btn{
        width:100%;
        justify-content:center;
    }

    table{
        font-size:14px;
    }
}

@media (display-mode: standalone){
    body{
        user-select:none;
    }

    input,
    textarea,
    [contenteditable="true"]{
        user-select:text;
        -webkit-user-select:text;
    }
}
