/* Shared page shell; legacy module layouts keep their existing styles. */
.site-shell {
    display: grid;
    grid-template-columns: 16em minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    width: 100%;
}
.site-shell > #side_left { grid-column: 1; grid-row: 1; padding: 3px; min-width: 0; }
.site-shell > #side_right { grid-column: 2; grid-row: 1 / 3; padding: 3px; min-width: 0; }
.site-shell #blk_body { overflow-x: auto; }
.site-sidebar-extra { grid-column: 1; grid-row: 2; min-width: 0; padding: 3px; }
.site-shell-full { grid-template-columns: minmax(0, 1fr); }
.site-shell-full > #side_right { grid-column: 1; }
.site-shell [hidden], .site-mobile-header [hidden] { display: none !important; }
.site-mobile-header { display: none; }
.site-skip-link { position: absolute; left: 8px; top: -100px; z-index: 20; }
.site-skip-link:focus { top: 8px; padding: 12px; background: white; color: #18186b; }
.site-page :focus-visible { outline: 2px solid #3535a0; outline-offset: 3px; }
.site-page #menu li:focus-within > ul { display: block; }
.site-page #side_right:focus { outline: none; }

@media (max-width: 48em) {
    .site-page { font-size: 16px; line-height: 1.5; }
    .site-mobile-header, .site-shell, .site-shell *, .site-community, .site-community *, .site-footer, .site-footer * { box-sizing: border-box; }
    .site-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 10px 12px;
        border-bottom: 1px solid #d8d8e3;
        background: #f5f5fa;
    }
    .site-mobile-brand { font-weight: bold; color: #191941; text-decoration: none; padding: 8px 0; }
    .site-mobile-actions { display: flex; flex-wrap: wrap; gap: 4px; }
    .site-mobile-actions > a, .site-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 8px 10px;
        border: 1px solid transparent;
        border-radius: 6px;
        background: transparent;
        color: #252571;
        font: inherit;
        text-decoration: none;
    }
    .site-menu-toggle { border-color: #c6c6d5; cursor: pointer; }
    .site-menu-toggle[aria-expanded="true"] { background: #e2e2f0; }
    .site-page:not(.site-menu-ready) .site-skip-link { position: static; display: inline-block; padding: 10px 12px; }
    .site-shell { display: flex; flex-direction: column; }
    .site-shell > #side_left, .site-shell > #side_right, .site-sidebar-extra { width: 100%; padding: 12px; }
    .site-desktop-brand { display: none; }
    .site-shell > #side_left { border-bottom: 1px solid #d8d8e3; background: #f5f5fa; }
    .site-page-club .site-mobile-header, .site-page-club .site-shell > #side_left { background: #ccc; border-color: #aaa; }
    .site-sidebar-extra { border-top: 1px solid #d8d8e3; }
    .site-page #header_syslinks { float: none; width: auto; margin: 0 0 8px; padding: 0; white-space: normal; font-size: .875rem; }
    .site-page #header_syslinks a { display: inline-block; padding: 8px 0 8px 12px; }
    .site-page #blk_path { width: auto; margin: 0 0 12px; padding: 0; overflow-wrap: anywhere; line-height: 1.5; }
    .site-page #blk_body { margin: 0 0 16px; overflow-wrap: anywhere; }
    .site-page h1 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 16px; }
    .site-page h2 { font-size: 1.25rem; line-height: 1.35; }
    .site-page #blk_body img, .site-sidebar-extra img { max-width: 100%; height: auto; }
    .site-page #blk_body input:not([type="hidden"]), .site-page #blk_body select,
    .site-page #blk_body textarea, .site-page #reg_block input, .site-page #panel_search input {
        max-width: 100%;
        font-size: 16px;
    }
    .site-page input[type="submit"], .site-page input[type="button"], .site-page button { min-width: 44px; min-height: 44px; }
    .site-page #reg_block input[type="text"], .site-page #reg_block input[type="password"] { width: 100% !important; min-height: 40px; }
    .site-page #reg_block, .site-page #panel_search { margin: 0 0 12px; padding: 12px; }
    .site-page #reg_block a { display: inline-block; padding: 6px 0; }
    .site-page #menu, .site-page #menu ul { width: auto; margin: 0; }
    .site-page #menu li ul, .site-page #menu li.menu_current ul {
        position: static;
        display: block;
        width: auto;
        border: 0;
        margin: 0 0 8px 16px;
    }
    .site-page #menu a, .site-page #menu li.menu_current ul li a { min-height: 44px; padding: 10px 12px; line-height: 1.5; }
    .site-page #menu li:hover { background: transparent; }
    .site-page #menu a:hover, .site-page #menu a:focus-visible { background: #e2e2f0; }
    .site-page #photo_rand, .site-page #adv_block { margin: 0 0 16px; }
    .site-community { padding: 0 12px; }
    .site-community > noindex > table, .site-community > noindex > table > tbody,
    .site-community > noindex > table > tbody > tr, .site-community > noindex > table > tbody > tr > td { display: block; width: 100%; }
    .site-community #minichat, .site-community #onliners { margin: 12px 0; padding: 0; }
    .site-community #onliners ul { max-height: 120px; }
    .site-community #minichat_msg_box { overflow-wrap: anywhere; }
    .site-community textarea { width: 100%; max-width: 100%; font-size: 16px; box-sizing: border-box; }
    .site-footer, .site-footer > tbody, .site-footer > tbody > tr, .site-footer > tbody > tr > td { display: block; width: 100%; }
    .site-footer > tbody > tr > td { padding: 12px; overflow-wrap: anywhere; }
    .site-footer > tbody > tr > td:last-child { text-align: left !important; }
}

@media print {
    .site-mobile-header, .site-skip-link, .site-navigation, .site-sidebar-extra { display: none !important; }
    .site-shell { display: block; }
}
