/* Registration/editing occupy the visual viewport. Only the portrait grid scrolls. */
#profile-screen[data-view=gallery]{top:var(--profile-viewport-top,0px);bottom:auto;height:var(--profile-viewport-height,100dvh);overflow:hidden;padding:calc(10px + env(safe-area-inset-top)) 18px calc(10px + env(safe-area-inset-bottom))}
#profile-screen[data-view=gallery] .profile-shell{box-sizing:border-box;min-height:0;height:100%;max-height:100%;padding:0;border:0;background:none;justify-content:flex-start}
#profile-screen[data-view=gallery] .profile-brand{flex:none;font-size:clamp(14px,2.2dvh,19px);margin:0 0 6px}
#profile-screen[data-view=gallery] h1{flex:none;font-size:clamp(18px,2.8dvh,26px);line-height:1.15;margin:0 0 4px}
#profile-screen[data-view=gallery] .profile-sub{flex:none;font-size:12px;line-height:1.3;margin:0 0 8px}
#profile-screen[data-view=gallery] #profile-form{display:flex;flex-direction:column;flex:1;min-height:0;gap:8px}
#profile-screen[data-view=gallery] .profile-identity{flex:none;gap:12px;margin:0;min-height:54px}
#profile-screen[data-view=gallery] #avatar-preview{width:54px}
#profile-screen[data-view=gallery] label{flex:none;font-size:12px}
#profile-screen .profile-identity{width:100%;min-width:0}
#profile-screen .profile-identity label{flex:1 1 0;min-width:0;max-width:100%}
#profile-screen #account-name{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}
#profile-screen[data-view=gallery] input:not([type=range]):not([type=checkbox]):not([type=file]){height:40px;min-height:40px;padding:8px 12px;margin:4px 0 0;font-size:16px}
#profile-screen[data-view=gallery] .password-field button{top:4px;height:40px;min-height:40px}
#profile-screen[data-view=gallery] .profile-tabs{flex:none;height:42px;min-height:42px;margin:0;padding:3px}
#profile-screen[data-view=gallery] .profile-tabs button{height:34px;min-height:34px;font-size:14px}
#profile-screen[data-view=gallery] .profile-grid{flex:1 1 0;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:max-content;align-content:start;gap:8px;margin:0;padding:3px;touch-action:pan-y}
#profile-screen[data-view=gallery] .profile-grid button{display:block;width:100%;height:auto;min-height:0;aspect-ratio:1;align-self:start}
#profile-screen[data-view=gallery] .profile-photo{flex:1;min-height:0;overflow:hidden;margin:0;display:flex;flex-direction:column;justify-content:center;align-items:center}
#profile-screen[data-view=gallery] .profile-photo[hidden]{display:none}
#profile-screen[data-view=gallery] #photo-preview{width:min(110px,20dvh);max-height:75%;margin:0}
#profile-screen[data-view=gallery] .profile-photo p{font-size:12px;margin:6px 0 0}
#profile-screen[data-view=gallery] #import-photo{flex:none;height:40px;min-height:40px;padding:6px;margin:0;font-size:13px}
#profile-screen[data-view=gallery] #profile-error{flex:none;font-size:12px;line-height:1.25;margin:0}
#profile-screen[data-view=gallery] #profile-error:empty{display:none}
#profile-screen[data-view=gallery] .profile-submit{flex:none;height:44px;min-height:44px;padding:8px;margin:0;font-size:15px}
#profile-screen[data-view=gallery] .profile-links{flex:none;margin:4px 0 0}
#profile-screen[data-view=gallery] .profile-links button{min-height:32px;padding:5px 10px;font-size:14px}
/* Make room for typing without moving the form behind the phone keyboard. */
#profile-screen[data-view=gallery][data-keyboard=true] :is(.profile-brand,h1,.profile-sub,.profile-tabs,.profile-grid,.profile-photo,#import-photo){display:none}
#profile-screen[data-view=gallery][data-keyboard=true] #profile-form{justify-content:center;gap:10px}
@media(max-height:600px){#profile-screen[data-view=gallery] :is(.profile-brand,.profile-sub){display:none}}
