/* YouCube 1.16: initial, server-selected layout. No loading screen or hidden page. */
body.local-youcubehome-server,
body.local-youcubehome-server-catalogue { background: #f5f7fb; }
.ych-server-host { display: block; width: 100%; min-width: 0; }
body.local-youcubehome-server #local-youcubehome {
    min-height: calc(100vh - 80px);
}
/* Release known content containers used by Moodle/Boost/Lambda. Containers
 * carrying the primary navbar are excluded; block and chat instances are not replaced.
 * :has() is CSS, evaluated before paint, not a delayed JS ancestor rewrite.
 * Browsers without :has keep their normal theme width; content remains visible. */
@supports selector(:has(*)) {
    body.ych-server-fullwidth :is(#page-content, #region-main-box, #region-main, [role="main"],
        .container, .container-fluid, .pagelayout-wrapper, .main-inner, .card-body, .row):has(#local-youcubehome, #local-youcubehome-mechanics):not(:has(.navbar, .primary-navigation, [data-region="primary-navigation"], nav.fixed-top, header[role="banner"], #nav-main)) {
        width: 100% !important; max-width: none !important; min-width: 0 !important;
        margin-inline: 0 !important; padding-inline: 0 !important;
        border-inline: 0 !important; box-shadow: none !important;
        background: #f5f7fb !important;
    }
    body.ych-server-fullwidth :is(#region-main-box, #region-main):has(#local-youcubehome, #local-youcubehome-mechanics) {
        flex: 1 1 100%; float: none; min-width: 0;
    }
}
body.local-youcubehome-server.local-youcubehome-fullwidth #local-youcubehome {
    max-width: none; width: 100%; padding-top: 0;
    --ych-compact-height: calc(158 * var(--ych-u));
}
body.local-youcubehome-server-catalogue #local-youcubehome-mechanics {
    left: auto; right: auto; width: 100%; max-width: none;
    min-height: calc(100vh - 80px);
}
@media (min-width: 1101px) {
    body.local-youcubehome-server.local-youcubehome-fullwidth #local-youcubehome {
        --ych-u: max(1px, calc(100vw / 1900));
    }
    body.local-youcubehome-server-catalogue.ychm-fullwidth #local-youcubehome-mechanics {
        --ychm-u: max(1px, calc(100vw / 1900));
    }
}
/* Search has its final size before its JavaScript listener is attached. */
body.local-youcubehome-server-catalogue .ychm-toolbar { min-height: 40px; }
body.local-youcubehome-server-catalogue .ychm-search input:disabled { opacity: 1; cursor: wait; }
