/* One viewport frame for the classic and Vue workspaces. The Vue root
 * replaces #content, so these must be peers, never nested offsets. */
#body-user > :is(#content, #content-vue):is(.app-modultheme, .app-dashboard, .app-files, .app-deck, .app-modulnotes, .app-modulhelpdesk, .app-modultasks, .app-modulcontacts, .app-modulmail, .app-modultalk, .app-modulcalendar, .app-modulassistant, .app-office, .app-photos, .app-activity, .app-modultables, .app-modulwiki) {
	position: fixed !important;
	inset-block-start: calc(var(--header-height) + var(--body-container-margin)) !important;
	inset-block-end: max(var(--body-container-margin), env(safe-area-inset-bottom, 0px)) !important;
	margin-block: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
}

/* Notes' internal margins used to duplicate the frame gutter.
 * Panel opacity is owned by the app's shared personalization tokens. */
#content.app-modulnotes .mn-shell > .mn-pane {
	margin: 0;
}
#content.app-modulnotes .mn-divider {
	width: var(--body-container-margin);
	min-width: 6px;
}

/* Keep the shared frame gutters. Helpdesk's own theme tokens control its
 * transparent canvas, wallpaper text and glass panels. */
#content.app-modulhelpdesk .hd-main {
	padding-block-start: var(--hd-s3);
}

/* ONLYOFFICE must fill the available workspace, not a second viewport below
 * the portal header. Both inline Files and standalone editor routes use it. */
#body-user.onlyoffice-inline #onlyofficeFrame {
	height: 100% !important;
	max-height: 100% !important;
	box-sizing: border-box;
}

/* The inline connector renders a base layout without the portal header.
 * Its document-server frame therefore needs no header offset or body gutter. */
body.layout-base #app > iframe[src*="/web-apps/apps/"] {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	border: 0;
}

#body-user > #content.app-onlyoffice {
	position: fixed !important;
	inset-block-start: calc(var(--header-height) + var(--body-container-margin)) !important;
	inset-block-end: max(var(--body-container-margin), env(safe-area-inset-bottom, 0px)) !important;
	margin-block: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	overflow: hidden;
}
#body-user > #content.app-onlyoffice #app {
	position: relative;
	width: 100%;
	height: 100%;
}
html #body-user > #content.app-onlyoffice #app > iframe {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	border: 0;
}
