/* =======================================================
   A Y R A . N E T  -  Mobile Layout v3
   Wird nach basic.css geladen und kapselt Mobile-Regeln.
   ======================================================= */

body.no-scroll {
    overflow: hidden;
    touch-action: none;
}

@media (max-width: 900px) {
    :root {
        --sidebar-w: 290px;
        --topbar-h: 64px;
        --gap: 12px;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .layout,
    .app-shell {
        display: block;
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .content-shell {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .layout .topbar,
    .topbar {
        position: sticky;
        top: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        max-width: 100vw;
        height: var(--topbar-h);
        min-height: var(--topbar-h);
        padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
        background: var(--sidebar-bg);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .topbar-left {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .topbar-title {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .topbar-title__icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        object-fit: cover;
        flex: 0 0 34px;
    }

    .topbar-title__texts {
        display: grid;
        gap: 2px;
        min-width: 0;
    }

    .topbar-title__sub {
        font-size: 12px;
        color: #bbb;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-title__main {
        font-size: 16px;
        font-weight: 800;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    button.burger,
    .burger {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin-left: auto;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.10);
        color: white;
        font-size: 22px;
        line-height: 1;
        display: inline-grid;
        place-items: center;
    }

    .layout .main,
    .main {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        min-height: calc(100vh - var(--topbar-h));
        min-height: calc(100dvh - var(--topbar-h));
        height: auto;
        padding: var(--gap);
        overflow-x: hidden;
        overflow-y: visible;
    }

    .main > .page-titlebar {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        width: var(--sidebar-w);
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar__inner {
        height: 100%;
        min-height: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 950;
        background: rgba(0, 0, 0, 0.55);
    }

    .sidebar p,
    .sidebar span,
    .sidebar .menu-label,
    .sidebar-user__text,
    .nav-group-title {
        display: block !important;
    }

    .sidebar-user {
        justify-content: flex-start;
        padding: 14px 12px;
    }

    .sidebar-user img {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .sidebar__logout {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .nav-group-content {
        max-height: 0;
        opacity: 0;
    }

    .nav-group:not(.collapsed) > .nav-group-content {
        max-height: 1000px;
        opacity: 1;
    }

    #standard-messages {
        top: calc(var(--topbar-h) + 10px);
        right: 10px;
        left: 10px;
    }

    .message-box {
        right: 0;
        width: 100%;
    }

    .ui-blocker__icon {
        height: 160px;
    }

    .ui-blocker__quote {
        font-size: clamp(2.4rem, 11vw, 4rem);
        padding: 0 14px;
        overflow-wrap: anywhere;
    }
}

@supports not (height: 100dvh) {
    @media (max-width: 900px) {
        .layout,
        .app-shell,
        .content-shell {
            min-height: 100vh;
        }

        .sidebar {
            height: 100vh;
        }
    }
}
