/* A shared reading scale for real dialog boxes. No scene scaling, layout
   reflow, or phone-orientation-guide rules belong in this layer. */
body .modal-overlay{padding:24px;box-sizing:border-box;}
body .modal-overlay .retro-modal{
 display:flex;flex-direction:column;box-sizing:border-box;min-width:0;
 width:min(clamp(760px,50vw,960px),calc(100vw - 48px));max-width:960px;
 max-height:calc(100dvh - 48px);overflow:hidden;animation:none;
}
body .modal-overlay .retro-modal-header{
 flex:0 0 auto;height:auto;min-height:58px;padding:10px 18px;gap:16px;
 font-size:21px;line-height:1.4;
}
body .modal-overlay .retro-modal-header>:not(button){min-width:0;overflow-wrap:anywhere;}
body .modal-overlay .retro-modal-header .win-btn{
 flex:0 0 44px;display:grid;place-items:center;min-width:44px;width:44px;
 min-height:44px;height:44px;padding:0;font-size:28px;line-height:1;
}
body .modal-overlay .retro-modal-body{
 flex:1 1 auto;min-height:0;max-height:none;padding:28px;
 overflow:auto;overscroll-behavior:contain;scroll-padding-block:24px;
 font-size:19px;line-height:1.75;
}
body .retro-modal-body :is(.modal-label,.modal-checkbox-row,.form-grid label){font-size:18px;line-height:1.6;}
body .retro-modal-body :is(input:not([type=checkbox]):not([type=radio]),textarea,select){font-size:19px!important;line-height:1.6;min-height:48px;max-width:100%;box-sizing:border-box;}
body .retro-modal-body .modal-textarea{height:190px;min-height:160px;}
body .retro-modal-body :is(.retro-btn,.dorm-primary,.shop-blue,.shop-outline,.prompt-btn-edit,.prompt-btn-copy){min-height:46px;font-size:18px!important;line-height:1.5;}
body .retro-modal-body :is(.community-consent,.community-publication-note,.community-error,.diary-ai-notice,.dorm-helper){font-size:15px;line-height:1.7;}
body .retro-modal-body .modal-actions{flex-wrap:wrap;gap:12px;margin-top:20px;}
body .retro-modal-body :is(p,h2,h3,h4,pre){overflow-wrap:anywhere;}
body .modal-overlay .y2k-alert-dialog{width:min(clamp(600px,36vw,740px),calc(100vw - 48px));max-width:740px;}

/* Article and prompt content share the outer dialog's one reading scroll. */
body.blog-page #blogDetailContent{font-size:19px;line-height:1.85;max-height:none;overflow:visible;padding:0;}
body.blog-page #blogDetailContent .ai-article{max-width:840px;font-size:19px;}
body.blog-page #blogDetailContent .ai-article h3{font-size:22px!important;}
body.blog-page #blogDetailContent .ai-article>p:first-child{font-size:15px!important;}
body.blog-page .retro-modal-body :is(.post-text-body,.prompt-text){font-size:19px;line-height:1.85;}
body.blog-page .retro-modal-body .prompt-text{max-height:none;overflow:visible;white-space:pre-wrap;overflow-wrap:anywhere;}
body.blog-page .retro-modal-body .prompt-card-title{font-size:21px;}
body.blog-page .retro-modal-body :is(.modal-meta,.prompt-card-footer){font-size:15px;line-height:1.65;}
body.sos-page #postitDetailTag{font-size:17px;line-height:1.5;}
body.sos-page #postitDetailQuestion{font-size:26px;line-height:1.55;margin:18px 0 26px;}
body.sos-page #postitDetailAnswer.sos-solution{font-size:19px;line-height:1.85;}
body.sos-page #postitDetailAnswer.sos-solution h3{font-size:22px;}
body.sos-page #postitDetailAnswer .sos-prompt-card :is(pre,p){font-size:17px;}
body.sos-page #postitDetailAnswer .sos-prompt-card h4{font-size:20px;}
body.sos-page #postitDetailAnswer.sos-solution small{font-size:15px;}
body.sos-page #postitDetailStats{font-size:18px;line-height:1.6;}

/* These windows were already wider; enlarge their own proportions modestly. */
body #dormModal .retro-modal{width:min(clamp(1000px,64vw,1200px),calc(100vw - 48px));max-width:1200px;}
body.dorm-page #dormModal[data-screen="quiz"] .retro-modal{width:min(clamp(780px,52vw,960px),calc(100vw - 48px));max-width:960px;}
body #dormModal .retro-modal-body,
body.dorm-page #dormModalBody,
body.dorm-page #dormModal[data-screen="quiz"] #dormModalBody{max-height:none;padding:28px;font-size:19px;}
body.dorm-page #dormModalBody :is(p,input,textarea){font-size:19px;}
body.dorm-page #dormModalBody .quiz-q{font-size:27px;}
body.dorm-page #dormModalBody .quiz-hint{font-size:16px;}
body.dorm-page #dormModal .quiz-opts button{font-size:19px;min-height:62px;}
body.shop-page #dormModal .retro-modal{width:min(clamp(1160px,70vw,1320px),calc(100vw - 48px));max-width:1320px;max-height:calc(100dvh - 48px);}
body.shop-page #dormModal .retro-modal-header{font-size:21px;padding:10px 18px;}
body.shop-page #dormModal .retro-modal-body{padding:30px;max-height:none;font-size:19px;line-height:1.75;}
body.shop-page #dormModal :is(.shop-facts dd,.shop-lead,.shop-order-guide,.shop-order-entry p,.shop-order-info,.shop-order-summary span,.shop-consents label,.shop-fulfillment label){font-size:17px;}
body.shop-page #dormModal :is(.shop-facts dt,.shop-small,.shop-consents p,.shop-product>small,.shop-mission small){font-size:15px;}
body.shop-page #dormModal .shop-guide h2{font-size:28px;}
body.shop-page #dormModal .shop-guide h3{font-size:19px;}
body.shop-page #dormModal .shop-guide :is(p,summary,.shop-guide-policy,.shop-guide-text-link){font-size:16px;}
body.shop-page #dormModal .shop-mood-grid strong{font-size:18px;}
body.shop-page #dormModal .shop-mood-grid>button>span{font-size:14px;}
body.shop-page #dormModal .shop-instagram-steps li{font-size:17px;}

/* Native comments keep the heading/close button outside their scrolling body. */
body .community-dialog{width:min(clamp(740px,46vw,920px),calc(100vw - 48px));max-width:920px;max-height:calc(100dvh - 48px);padding:0;overflow:hidden;font-size:19px;}
body .community-dialog[open]{display:flex;flex-direction:column;}
body .community-dialog-header{flex:0 0 auto;padding:18px 26px 14px;border-bottom:1px dashed #b9c8dc;gap:16px;}
body .community-dialog-header h2{font-size:26px;line-height:1.4;}
body .community-dialog .community-dialog-header button{flex:none;width:44px;height:44px;padding:0;font-size:28px;line-height:1;}
body .community-dialog-body{flex:1 1 auto;min-height:0;padding:20px 26px 26px;overflow:auto;overscroll-behavior:contain;scroll-padding-block:20px;}
body .community-dialog .community-subtitle{font-size:17px;line-height:1.65;overflow-wrap:anywhere;}
body .community-dialog .community-comment-list{max-height:none;overflow:visible;}
body .community-dialog .community-comment p{font-size:18px;line-height:1.75;}
body .community-dialog .community-comment-meta{font-size:15px;}
body .community-dialog :is(.community-consent,.community-error){font-size:15px;}
body .community-dialog .community-comment-form textarea{font-size:18px;line-height:1.6;min-height:130px;}
body .community-dialog button{min-height:44px;font-size:17px;}
body .community-dialog:not(:has(.community-dialog-header)){padding:28px;gap:20px;overflow:auto;}

/* Promotion remains a concise single column; the outer window grows with it. */
body .benefits-dialog{width:min(clamp(620px,36vw,760px),calc(100vw - 48px));max-width:760px;max-height:calc(100dvh - 48px);}
body .benefits-dialog[open]{display:flex;flex-direction:column;}
body .benefits-dialog-bar{flex:0 0 auto;padding:10px 18px;font-size:17px;}
body .benefits-dialog-bar button{flex:none;width:44px;height:44px;font-size:28px;}
body .benefits-dialog-body{flex:1 1 auto;min-height:0;max-height:none;padding:26px 36px 22px;overflow:auto;font-size:17px;line-height:1.7;}
body .benefits-dialog .benefits-gemini-logo{width:176px;margin-bottom:22px;}
body .benefits-dialog h2{font-size:35px;line-height:1.4;}
body .benefits-dialog .benefits-eyebrow{font-size:14px;}
body .benefits-dialog .benefits-offer{font-size:19px;}
body .benefits-dialog .benefits-offer strong{font-size:23px;}
body .benefits-dialog .benefits-offer span{font-size:13px;}
body .benefits-dialog .benefits-uses>span{font-size:16px;padding:14px 6px;}
body .benefits-dialog .benefits-uses i{font-size:28px;}
body .benefits-dialog .benefits-actions>.benefits-primary{font-size:19px;min-height:54px;}
body .benefits-dialog :is(.benefits-conditions,.benefits-more){font-size:14px;line-height:1.75;}
body .benefits-dialog .benefits-more summary{min-height:36px;}
body .benefits-dialog .benefits-operator{font-size:12px;}
body .benefits-dialog-footer{flex:0 0 auto;padding:8px 18px;}
body .benefits-dialog-footer button{min-height:44px;font-size:15px;}

/* Short browser windows still expose close and the complete scrolling content. */
@media(max-height:560px){
 body .modal-overlay{padding:12px;}
 body .modal-overlay .retro-modal,body.shop-page #dormModal .retro-modal,body .community-dialog,body .benefits-dialog{max-height:calc(100dvh - 24px);}
 body .modal-overlay .retro-modal-body,body #dormModal .retro-modal-body,body.dorm-page #dormModalBody,body.dorm-page #dormModal[data-screen="quiz"] #dormModalBody,body.shop-page #dormModal .retro-modal-body{padding-block:20px;}
 body .benefits-dialog-body{padding-block:20px;}
}
