/* Layouts keep their original CSS and DOM; only the active tree is attached. */
html.lapia-js:not(.lapia-ready) #lapia-layout { visibility: hidden; }
#lapia-layout { display: block; }
body > #lapia-layout > #primary { height: auto; }
html[data-lapia-view="sp"][data-lapia-canvas="640"] body {
    width: 640px;
    zoom: var(--lapia-scale, 1);
    margin: 0;
}
html[data-lapia-view="pc"] body { zoom: 1; }
@media print {
    html.lapia-js #lapia-layout { visibility: visible; }
}

/* Keep normal-page menus in view as soon as they reach the top, without the
   legacy homepage-only 350px threshold or a jump when fixed positioning starts. */
html[data-lapia-view="sp"] #lapia-layout #navi[data-lapia-main-navigation="1"] {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
}

/* Hidden before legacy JS loads; jQuery's inline display value still opens it. */
html[data-lapia-view="sp"] #lapia-layout #sidesns { display: none; }
