/* Dialogs are reading and working surfaces, with one predictable scroll area. */
body:has(dialog[open]){overflow:hidden}
body dialog{box-sizing:border-box;width:min(1040px,calc(100vw - 48px));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);margin:auto;border-radius:22px;overflow:auto;overscroll-behavior:contain;font-size:16px}
body #articleDialog,body #threadDialog,body #askDialog,body #searchDialog,body #topicsDialog,body #moderationDialog{width:min(1080px,calc(100vw - 48px));max-width:calc(100vw - 48px);height:min(860px,calc(100dvh - 48px));max-height:calc(100dvh - 48px)}
body #authDialog,body #passwordSignInDialog,body #reportDialog,body #moderationActionDialog{width:min(800px,calc(100vw - 48px));max-width:calc(100vw - 48px)}
body dialog .dialog-top{position:sticky!important;top:0!important;min-height:72px;padding:10px 24px!important;z-index:25;font-size:15px;flex-shrink:0}
body dialog .dialog-top>span{font-size:15px!important;font-weight:650}
body dialog .dialog-top [data-close]{width:48px;height:48px;min-width:48px;min-height:48px;border:1px solid #d4ddd4;border-radius:50%;background:#fff;color:#234334;font-size:28px;line-height:1;display:grid;place-items:center}
body dialog :is(.dialog-body,#articleContent,#threadContent,.feature-dialog-body,.journal-search,.topics-panel,.public-profile-content){padding:32px 40px}
body dialog :is(.auth-form,.profile-form){padding:30px 40px;max-width:820px;margin:0 auto}
body #articleContent .article-photo{height:clamp(250px,36vh,420px);border-radius:15px}
body dialog :is(.dialog-body h2,#articleContent h2,#threadContent h2,.auth-form h2,.profile-form-head h2,.topics-panel h2){font-size:clamp(30px,3.4vw,46px);line-height:1.12}
body dialog :is(p,.article-body-text,.thread-reply p,.thread-body,.auth-form>p,.profile-form-head p,.feature-dialog-body p,.guidelines-list li){font-size:16px!important;line-height:1.75!important}
body dialog :is(.field,.field>span,.profile-field>span,.role-picker legend,.photo-copy>b,.professional-settings-head b,.security-head b,.search-input-wrap input,.topic-follow-card b){font-size:15px!important;line-height:1.5}
body dialog :is(input,select,textarea){font-size:16px!important;line-height:1.5}
body dialog :is(.field input,.field select,.profile-field input,.more-role select){min-height:54px;padding:13px 15px}
body dialog textarea{min-height:145px}
body dialog :is(small,.eyebrow,.auth-foot,.profile-local,.photo-copy>span,.security-head p,.professional-settings-head p,.profile-impact small,.role-picker>p,.photo-composer small,.video-composer p){font-size:13px!important;line-height:1.6!important}
body dialog :is(.form-submit,.security-action,.signout-btn,.upload-btn,.text-btn,.photo-add,.returning-signin,.topics-done,.public-profile-venwed,.moderation-entry){min-height:48px;font-size:14px!important}
body dialog :is(.form-submit span,.form-submit b,.role-choice span,.post-type b,.poll-option,.feed-actions button,.thread-reply b,.thread-author,.thread-meta,.community-author-link,.helpful-button){font-size:14px!important;line-height:1.5}
body dialog .role-choice{min-height:62px;padding:12px}
body dialog .role-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
body dialog .post-type-picker{gap:12px}
body dialog .post-type small{font-size:12px!important}
body dialog .photo-composer,body dialog .video-composer{padding:20px}
body #profileDialog.profile-settings-v2{width:min(1050px,calc(100vw - 48px))!important;max-width:calc(100vw - 48px)!important;height:min(900px,calc(100dvh - 48px))!important;max-height:calc(100dvh - 48px)!important;overflow:auto!important;margin:auto!important;border-radius:22px!important}
body #profileDialog .profile-welcome{display:none!important}
body #profileDialog .profile-layout{display:block!important;height:auto!important;min-height:0!important;overflow:visible!important}
body #profileDialog .profile-form{display:flex;flex-direction:column;gap:22px;width:100%!important;height:auto!important;overflow:visible!important;padding:30px 36px 38px!important}
body #profileDialog .profile-form>*{margin-top:0;margin-bottom:0}
body #profileDialog .profile-dialog-top{position:sticky!important;top:0!important;min-height:72px!important}
body #profileDialog .profile-submit{position:relative!important;inset:auto!important;width:100%!important;min-height:56px!important;flex-shrink:0;margin-top:4px!important}
body #profileDialog .photo-card{grid-template-columns:90px 1fr;gap:18px;padding:20px}
body #profileDialog .photo-preview{width:90px;height:90px}
body #profileDialog .photo-copy>span{max-width:none}
body #profileDialog .profile-account{flex-wrap:wrap;gap:18px}
body #profileDialog .profile-account>div{max-width:100%;min-width:0}
body #searchDialog .search-input-wrap input{min-height:56px}
body #searchDialog .search-result{padding:20px}
body #searchDialog .search-result b{font-size:18px}
body #photoLightbox{width:min(1280px,calc(100vw - 40px));max-width:calc(100vw - 40px)}
@media(max-width:700px){
 body dialog,body #articleDialog,body #threadDialog,body #askDialog,body #searchDialog,body #topicsDialog,body #moderationDialog,body #authDialog,body #passwordSignInDialog,body #reportDialog,body #moderationActionDialog,body #profileDialog.profile-settings-v2,body #photoLightbox{position:fixed!important;inset:0!important;width:100%!important;max-width:100%!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:auto!important}
 body dialog .dialog-top,body #profileDialog .profile-dialog-top{position:sticky!important;top:0!important;min-height:calc(68px + env(safe-area-inset-top))!important;padding:calc(8px + env(safe-area-inset-top)) 16px 8px 20px!important}
 body dialog :is(.dialog-body,#articleContent,#threadContent,.feature-dialog-body,.journal-search,.topics-panel,.public-profile-content,.auth-form){padding:24px 20px calc(32px + env(safe-area-inset-bottom))}
 body #profileDialog .profile-form{padding:24px 20px calc(34px + env(safe-area-inset-bottom))!important;gap:22px}
 body dialog :is(.dialog-body h2,#articleContent h2,#threadContent h2,.auth-form h2,.profile-form-head h2,.topics-panel h2){font-size:34px}
 body #articleContent .article-photo{height:260px}
 body dialog .role-grid{grid-template-columns:1fr 1fr}
 body #profileDialog .photo-card{grid-template-columns:70px 1fr;padding:16px;gap:14px}
 body #profileDialog .photo-preview{width:70px;height:70px}
 body dialog .photo-composer,body dialog .video-composer{padding:16px}
 body dialog .post-type-picker{gap:8px}
 body dialog .post-type{padding:12px}
 body dialog .thread-author{gap:8px}
 body dialog .lightbox-content{padding:16px}
 body dialog .lightbox-content img{max-height:calc(100dvh - 210px)}
}
