/* One outer web shell; cabinets keep only their internal workspace/navigation. */
html:has(body.sb-site-layout) { background: var(--sb-theme-control,#edf2f8); }
body.sb-site-layout {
 --app-max:1920px; --page:1920px; --workspace-max:1920px;
 display:flex; flex-direction:column; width:min(100%,1920px); max-width:none;
 min-width:320px; min-height:100dvh; margin:0 auto; padding:0;
 color:var(--sb-color-text); background:var(--sb-theme-surface,#fff); font-size:var(--sb-type-body-size); line-height:var(--sb-type-body-leading);
}
.sb-site-layout > .app-header { flex:none; width:100%; background:var(--sb-theme-surface,#fff); }
.sb-site-layout > main, .sb-site-content { flex:1 0 auto; min-width:0; }
.sb-site-content { width:100%; background:var(--sb-theme-surface,#fff); }
.sb-site-layout .app-width { width:calc(100% - 48px); max-width:none; margin-inline:auto; }
.sb-site-layout .app-header__inner { max-width:none; }
.sb-site-layout .app-header { color:var(--sb-color-text); font-size:var(--sb-type-body-size); line-height:var(--sb-type-body-leading); }
.sb-site-layout .app-header a { text-decoration:none; }
.sb-site-layout .app-header .search-box input[type=search] { width:100%; min-width:0; border:0; background:transparent; color:var(--sb-color-text); font-size:var(--sb-type-control-size); line-height:var(--sb-type-control-leading); border-radius:0; padding:0; }
.sb-site-layout .app-header .search-box { width:100%; border-radius:999px; }
.sb-site-layout .app-header .header-actions { align-items:center; }
.sb-site-layout .app-header .location-button { display:flex; align-items:center; justify-content:center; list-style:none; cursor:pointer; line-height:var(--sb-type-control-leading); }
.shell-location { position:relative; }
.shell-location > summary::-webkit-details-marker { display:none; }
.shell-location__panel {
 position:fixed; top:72px; right:max(12px,calc((100vw - 1920px)/2 + 24px)); z-index:120;
 display:grid; gap:10px; width:min(290px,calc(100vw - 24px));
 padding:16px; border:0; border-radius:18px; background:var(--sb-theme-surface,#fff); box-shadow:0 12px 35px #152e5326;
}
.shell-location__panel label { font-size:var(--sb-type-caption-size); font-weight:var(--sb-type-caption-weight); color:var(--sb-color-text); }
.shell-location__panel select, .shell-location__panel button {
 width:100%; min-height:44px; padding:10px 12px; border:0; border-radius:12px;
 background:var(--sb-theme-control,#f1f5f9); color:var(--sb-color-text); font:inherit;
}
.shell-location__panel button { background:var(--sb-theme-surface,#e4edff); color:var(--sb-color-action); cursor:pointer; }
.sb-site-layout .site-footer.home-footer { flex:none; width:100%; margin-top:0; background:var(--sb-theme-surface,#f7f8fc); color:var(--sb-color-muted); font-size:var(--sb-type-body-size); line-height:var(--sb-type-body-leading); }
.sb-site-layout .home-footer__group a, .sb-site-layout .home-footer__group button,
.sb-site-layout .home-footer__inactive, .sb-site-layout .home-footer__heading { font-size:var(--sb-type-control-size); line-height:var(--sb-type-control-leading); }
.sb-site-layout .home-footer__heading { color:var(--sb-color-text); }
.sb-site-layout .home-footer__intro p { color:var(--sb-color-muted); font-size:var(--sb-type-body-size); line-height:var(--sb-type-body-leading); }
.sb-site-layout .cabinet-shell, .sb-site-layout .master-shell, .sb-site-layout .adm-app {
 width:100%; max-width:none; margin:0; min-height:0;
}
.sb-site-layout .cabinet-sidebar, .sb-site-layout .master-sidebar, .sb-site-layout .adm-sidebar {
 height:auto; min-height:0; align-self:stretch; position:relative; top:auto;
}
.sb-site-layout .cabinet-main, .sb-site-layout .master-main, .sb-site-layout .adm-workspace { min-width:0; }
.sb-site-layout .cabinet-content { max-width:none; }
.sb-site-layout .client-container, .sb-site-layout .inbox-shell, .sb-site-layout .thread-wrap,
.sb-site-layout .admin-portal__shell, .sb-site-layout .adm-inbox-main, .sb-site-layout .adm-inbox-head {
 width:calc(100% - 48px); max-width:none; margin-inline:auto;
}
.sb-site-layout .auth-shell { width:calc(100% - 48px); max-width:480px; min-height:0; margin:32px auto 48px; padding:0; }
.sb-site-layout .auth-card, .sb-site-layout .registration-card { width:100%; }
.sb-site-layout .page-main { width:calc(100% - 48px); max-width:none; margin-inline:auto; }
.sb-site-layout .auth-panel { max-width:480px; margin-inline:auto; }
.sb-site-layout .adm-main { max-width:none; }
.sb-site-layout .thread-topbar, .sb-site-layout .inbox-topbar { position:static; }
.sb-site-layout .thread-main, .sb-site-layout .inbox-main, .sb-site-layout .client-main { padding-bottom:32px; }
.sb-cabinet-menu { display:none; margin:12px; border-radius:14px; background:var(--sb-theme-control,#f1f5fb); }
.sb-cabinet-menu summary { min-height:44px; padding:12px 16px; cursor:pointer; font-weight:var(--sb-type-control-weight); }
.sb-cabinet-menu__links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:8px; }
.sb-cabinet-menu__links a { display:flex; align-items:center; gap:8px; min-height:44px; padding:10px; color:var(--sb-color-action); text-decoration:none; border-radius:10px; }
.sb-cabinet-menu__links a.is-active { background:var(--sb-theme-surface,#e4edff); }
@media (max-width:1023px) {
 .sb-site-layout .app-header .header-search .search-box input[type=search] { font-size:var(--sb-type-control-size); min-height:40px; }
}
@media (max-width:959px) { .sb-cabinet-menu { display:block; } }
@media (min-width:960px) and (max-width:1179px) { .sb-site-content:has(.master-shell) > .sb-cabinet-menu { display:block; } }
@media (max-width:650px) {
 .sb-site-layout .app-width, .sb-site-layout .client-container, .sb-site-layout .inbox-shell,
 .sb-site-layout .thread-wrap, .sb-site-layout .admin-portal__shell,
 .sb-site-layout .adm-inbox-main, .sb-site-layout .adm-inbox-head, .sb-site-layout .page-main { width:calc(100% - 24px); }
 .sb-site-layout .auth-shell { width:calc(100% - 24px); margin-block:20px 32px; }
}
@media (min-width:1921px) {
 html:has(body.sb-site-layout) { background:#edf2f8 url('../media/editorial/kitchen.jpg') center/cover fixed; }
}

/* No empty private toolbar when the existing renderer has no logout action. */
.sb-site-layout .client-header:not(:has(form)) { display:none; }

/* In-content actions stop before the common footer. */
.sb-site-layout .thread-compose, .sb-site-layout .pp-mobile-action { position:sticky; inset:auto; bottom:0; width:100%; }
@media(max-width:720px) { .sb-site-layout .pp-page { padding-bottom:16px; } }

.desktop-site-menu__panel--cabinet .desktop-site-menu__links { flex:1; }
.desktop-site-menu__panel--cabinet .desktop-site-menu__heading:not(:first-child) { margin-top:12px; }
.desktop-site-menu__panel--cabinet a[aria-current="page"] { color:var(--sb-color-action); background:var(--sb-surface-control); font-weight:var(--sb-type-section-weight); }
.desktop-site-menu__panel--cabinet a[aria-current="page"] .sb-icon-slot { color:inherit; }
.desktop-site-menu__panel--cabinet .desktop-site-menu__home { margin-top:12px; }
.desktop-site-menu__panel--cabinet > .desktop-site-menu__logout { flex:none; margin:0; border-top:1px solid var(--sb-surface-control); padding:6px 12px max(6px,env(safe-area-inset-bottom)); }
.desktop-site-menu__panel--cabinet .desktop-site-menu__logout button { display:flex; align-items:center; gap:12px; width:100%; min-height:44px; padding:10px 12px; border:0; border-radius:var(--sb-radius-control); font:inherit; font-weight:var(--sb-type-control-weight); color:var(--sb-color-text); background:transparent; }
.desktop-site-menu__panel--cabinet .desktop-site-menu__logout button:is(:hover,:focus-visible) { color:var(--sb-color-action); background:var(--sb-surface-control); }
