@@ -408,6 +408,9 @@ function getMaxScrollOffset(target: LayoutNode): number {
408408 }
409409
410410 const isVertical = target.node.type === "vstack";
411+ const props = target.node.type !== "text" ? target.node.props : null;
412+ const padX = (props as any)?.padding?.x ?? 0;
413+ const padY = (props as any)?.padding?.y ?? 0;
411414
412415 if (isVertical) {
413416 let contentHeight = 0;
@@ -415,14 +418,16 @@ function getMaxScrollOffset(target: LayoutNode): number {
415418 const childBottom = child.rect.y + child.rect.height - rect.y;
416419 if (childBottom > contentHeight) contentHeight = childBottom;
417420 }
418- return Math.max(0, contentHeight - rect.height);
421+ // Viewport is the inner height (minus bottom padding)
422+ // Content starts at padY, so contentHeight includes top padding offset
423+ return Math.max(0, contentHeight + padY - rect.height);
419424 } else {
420425 let contentWidth = 0;
421426 for (const child of children) {
422427 const childRight = child.rect.x + child.rect.width - rect.x;
423428 if (childRight > contentWidth) contentWidth = childRight;
424429 }
425- return Math.max(0, contentWidth - rect.width);
430+ return Math.max(0, contentWidth + padX - rect.width);
426431 }
427432 }