diff --git a/apps/pwa/src/components/CredentialSheet.tsx b/apps/pwa/src/components/CredentialSheet.tsx index f2d0157..f1ded69 100644 --- a/apps/pwa/src/components/CredentialSheet.tsx +++ b/apps/pwa/src/components/CredentialSheet.tsx @@ -153,6 +153,7 @@ export function CredentialSheet({ const heading = headingFor(mode); const isPending = credentialMutation.isPending; const saveDisabled = isPending || password.trim().length === 0 || email.trim().length === 0; + const phone = window.matchMedia('(max-width: 767px)').matches; return ( <> @@ -173,20 +174,37 @@ export function CredentialSheet({ role="dialog" aria-modal="true" aria-label={heading} - style={{ - position: 'fixed', - bottom: 0, - left: 0, - right: 0, - background: 'var(--color-surface)', - borderRadius: '12px 12px 0 0', - boxShadow: '0 -4px 24px rgba(0,0,0,0.15)', - padding: 'var(--space-6, 24px)', - zIndex: 301, - fontFamily: 'var(--font-family-base)', - maxWidth: '480px', - margin: '0 auto', - }} + style={ + phone + ? { + position: 'fixed', + bottom: 0, + left: 0, + right: 0, + background: 'var(--color-surface)', + borderRadius: '12px 12px 0 0', + boxShadow: '0 -4px 24px rgba(0,0,0,0.15)', + padding: 'var(--space-6, 24px)', + zIndex: 301, + fontFamily: 'var(--font-family-base)', + } + : { + position: 'fixed', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + maxWidth: '480px', + width: 'calc(100% - var(--space-8, 32px))', + maxHeight: 'calc(100dvh - var(--space-8, 32px))', + overflowY: 'auto', + background: 'var(--color-surface)', + borderRadius: '12px', + boxShadow: '0 8px 32px rgba(0,0,0,0.18)', + padding: 'var(--space-6, 24px)', + zIndex: 301, + fontFamily: 'var(--font-family-base)', + } + } > {/* Heading */}