/* Native controls and portal roots from Element Web 1.12.35. Scope portal rules
   to the authenticated work menu so login and verification keep their own UI. */
body:has(.mx_MatrixChat[data-mb-work]) :is(
    .mx_MessageActionBar :is(button,[role=button]):not([data-mb-allowed]),
    .mx_MessageContextMenu :is([role=menuitem],.mx_IconizedContextMenu_item):not([data-mb-allowed]),
    .mx_MessageContextMenu .mx_IconizedContextMenu_optionList:not(:has([data-mb-allowed])),
    .mx_MessageComposer_Menu,
    .mx_MessageComposer_actions > :not(.mx_EmojiButton,.mx_MessageComposer_sendMessage,[data-testid=sendmessagebtn]),
    .mx_UserSettingsDialog [role=tablist],
    .mx_UserSettingsDialog .mx_TabbedView_tabPanel:not(#mx_tabpanel_USER_APPEARANCE_TAB,#mx_tabpanel_USER_SESSION_MANAGER_TAB,#mx_tabpanel_USER_ENCRYPTION_TAB),
    #mx_tabpanel_USER_SESSION_MANAGER_TAB .mx_DeviceDetails_section > .mx_AccessibleButton_kind_danger_inline,
    #mx_tabpanel_USER_SESSION_MANAGER_TAB :is([data-testid="device-detail-sign-out-cta"], .mx_LoginWithQRSection, [data-testid="current-session-menu"], [data-testid="other-sessions-menu"], .mx_SelectableDeviceTile_checkbox > :has(input[type="checkbox"]), .mx_FilteredDeviceList_headerButton, .mx_DeviceDetailHeading_renameCta, .mx_DeviceDetails_pushNotifications),
    .mx_UserInfo:not(.mx_UserInfo_smallAvatar) .mx_UserInfo_container:not(.mx_UserInfo_header),
    .mx_RoomSettingsDialog .mx_SettingsDialog_content,
    .mx_ThreadView,
    .mx_MPollBody_allOptions,
    [data-mb-command] .mx_Autocomplete
) { display: none !important; }
/* The native checkbox label contains the device name and its details button. */
body:has(.mx_MatrixChat[data-mb-work]) #mx_tabpanel_USER_SESSION_MANAGER_TAB .mx_SelectableDeviceTile_checkbox label { pointer-events: none; }
body:has(.mx_MatrixChat[data-mb-work]) #mx_tabpanel_USER_SESSION_MANAGER_TAB .mx_DeviceExpandDetailsButton { pointer-events: auto; }
.mx_UserSettingsDialog:has(#mx_tabpanel_USER_APPEARANCE_TAB) .mx_TabbedView_tabPanel { flex: 1 1 100%; }
#mb-work-appearance svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.mb-command-notice { margin: .25rem .75rem; color: var(--cpd-color-text-primary, CanvasText); font: inherit; }

#mb-backup-status {
    padding: .75rem 1rem;
    border: 1px solid currentColor;
    border-radius: .5rem;
}
