/* Shared dialog rhythm, including installed PWA safe areas. */
:root{--dialog-edge:24px;--dialog-section-gap:16px;--dialog-field-gap:10px}
dialog[open]{box-sizing:border-box;max-width:calc(100% - 2 * var(--dialog-edge));max-height:calc(100vh - 2 * var(--dialog-edge));max-height:calc(100dvh - 2 * var(--dialog-edge) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));overscroll-behavior:contain;scroll-padding:16px;overflow-wrap:anywhere}
dialog.profile-modal[open]{max-height:calc(100dvh - 2 * var(--dialog-edge) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;border:1px solid var(--ui-border,#e8eaf4);border-radius:18px}
dialog .profile-head,dialog .history-head,dialog .request-heading{gap:12px;align-items:center;margin-bottom:var(--dialog-section-gap)}
dialog .profile-head h2,dialog .history-head h2{min-width:0;line-height:1.4}
dialog .profile-head button,dialog .history-head button{flex-shrink:0}
dialog .profile-btn,dialog .request-footer .btn{min-height:44px;box-sizing:border-box;border-radius:10px}
dialog .profile-actions,dialog .request-footer{gap:10px;margin-top:20px}
dialog #myUserDetails,dialog .profile-fields{gap:var(--dialog-field-gap)}
dialog .profile-field{margin:0!important;padding:12px 14px;gap:4px}
dialog .profile-field input{min-width:0;min-height:44px;font-size:16px;padding:8px 10px;line-height:1.5}
dialog .profile-field input[readonly]{padding:8px 10px;border-color:transparent;box-shadow:none}
dialog .profile-field input:not([readonly]){border-color:var(--ui-primary,#5658e8);background:#fff}
dialog #myPasswordForm{margin:0;padding:0;border:0}
dialog #myPasswordNewFields:not([hidden]){margin-top:16px!important}
dialog #myPasswordMessage:empty,dialog #myProfileStatus:empty,dialog #apStatus:empty{display:none}
dialog #myPasswordToggle{margin:0}
dialog .company-field{min-width:0;line-height:1.5}
@media(max-width:767px){:root{--dialog-edge:12px;--dialog-section-gap:14px;--dialog-field-gap:8px}dialog.profile-modal[open]{width:calc(100% - 24px)!important;padding:16px!important}dialog .profile-actions>button,dialog .request-footer>button{flex:1 1 auto;min-width:0}dialog .profile-head h2{font-size:18px}dialog .profile-field{padding:10px 12px}dialog input:not([type=checkbox]):not([type=radio]),dialog select,dialog textarea{font-size:16px}dialog .profile-btn{padding:10px 12px}}

/* Keep dialog headings and close targets consistent across member and admin screens. */
dialog .notification-head, dialog .push-dialog-head {
  gap: var(--ui-gap);
  margin-bottom: var(--dialog-section-gap);
}
dialog :is(.notification-head, .push-dialog-head) h2 {
  min-width: 0;
  line-height: 1.4;
}
dialog :is(.notification-head > button, .push-dialog-close) {
  flex-shrink: 0;
  min-width: var(--ui-control-height);
  min-height: var(--ui-control-height);
  box-sizing: border-box;
}
dialog.push-settings-dialog .push-settings { padding-top: 0; }

/* Member navigation and content alignment: same geometry on both entry documents. */
body:is(.mobile-member,.mobile-public.signed-member-nav)>header{box-sizing:border-box;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 5px 24px #1a28500a}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav button{box-sizing:border-box}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav button[hidden]{display:none!important}
body:is(.mobile-member,.mobile-public.signed-member-nav)>main:is(.wrap,.member-wrap){width:100%;max-width:1200px;margin-inline:auto;padding:32px 24px;box-sizing:border-box}
body.mobile-public.signed-member-nav #members .dashhead{margin:0 0 24px;align-items:center}
body.mobile-public.signed-member-nav #members .dashhead h1,body.mobile-member main.member-wrap>h1{font-size:28px;line-height:1.35;margin:0;color:var(--navy)}
body.mobile-member main.member-wrap>h1{margin-bottom:24px}
@media(min-width:768px){
body:is(.mobile-member,.mobile-public.signed-member-nav)>header{height:74px!important;min-height:74px!important;padding:0 max(24px,calc((100% - 1152px)/2))!important;flex-wrap:nowrap!important;gap:0!important}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav{display:flex;align-items:center;justify-content:flex-end;gap:8px!important;width:auto!important;margin:0 0 0 auto!important;padding:0!important;flex-wrap:nowrap!important;overflow:visible}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav button{font:inherit!important;font-size:14px!important;font-weight:700!important;padding:11px 14px!important;border-radius:9px;color:#52637a}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav button:is(.active,:hover){background:#eff4ff;color:#5658e8}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav :is(#proposalBell,#publicProposalBell){display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:48px;flex-shrink:0}
}
@media(max-width:767px){
body:is(.mobile-member,.mobile-public.signed-member-nav)>header{padding:12px 14px!important;min-height:60px!important;height:auto!important;gap:10px!important}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav{width:100%;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav button[data-page]:not([hidden]){min-height:54px;padding:4px 1px;font-size:11px}
body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav :is(#proposalBell,#publicProposalBell){position:fixed;top:10px;right:14px;min-width:44px;min-height:44px;padding:8px;display:inline-flex;align-items:center;justify-content:center;gap:4px;background:white;z-index:31}
body:is(.mobile-member,.mobile-public.signed-member-nav)>main:is(.wrap,.member-wrap){padding:20px 14px}
body.mobile-public.signed-member-nav #members .dashhead h1,body.mobile-member main.member-wrap>h1{font-size:24px}
}

/* Use the available document width, not viewport width including the scrollbar. */
html:has(body:is(.mobile-public,.mobile-member)){scrollbar-gutter:stable}
@media(min-width:768px){body:is(.mobile-public,.mobile-member)>header{padding-inline:max(24px,calc((100% - 1152px)/2))!important}body:is(.mobile-public,.mobile-member)>main:is(.wrap,.member-wrap){width:100%;max-width:1200px;margin-inline:auto!important;padding-inline:24px!important;box-sizing:border-box}body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav :is(#proposalBell,#publicProposalBell){width:48px;position:relative;padding:0!important}body:is(.mobile-member,.mobile-public.signed-member-nav)>header nav :is(#bellCount,#publicBellCount):not(:empty){position:absolute;top:0;right:0}}
@media(max-width:767px){html:has(body:is(.mobile-public,.mobile-member)){scrollbar-gutter:auto}}


/* Public and authentication chrome: one visual contract. */
html:has(body.saas-auth){scrollbar-gutter:stable}
body.saas-auth>header.site-header{box-sizing:border-box;position:sticky;top:0;z-index:10;background:#fff!important;border-bottom:1px solid #e8eaf4!important;box-shadow:0 5px 24px #1a28500a}
@media(min-width:768px){
body:is(.mobile-public,.saas-auth)>header{height:74px!important;min-height:74px!important;padding:0 max(24px,calc((100% - 1152px)/2))!important;flex-wrap:nowrap!important;gap:0!important}
body.saas-auth>header .site-nav{display:flex;align-items:center;justify-content:flex-end;margin:0 0 0 auto;gap:8px;flex-wrap:nowrap}
body.saas-auth>header .site-nav a{display:inline-flex;align-items:center;justify-content:center;font:inherit!important;font-size:14px!important;font-weight:700!important;line-height:normal!important;padding:11px 14px!important;border-radius:9px!important;color:#52637a!important;background:transparent!important;white-space:nowrap}
body.saas-auth>header .site-nav a:is(.selected,:hover){background:#eff4ff!important;color:#5658e8!important}
body.saas-auth>header .site-nav a#navSignup{background:#5658e8!important;color:#fff!important;padding:14px 22px!important;border-radius:12px!important}
body.saas-auth>header .site-nav a#navSignup:hover{filter:brightness(.95)}
}
body:is(.mobile-public,.mobile-member,.saas-auth) .upmate-footer-inner>button{margin:0!important;background:#fff!important;border:1px solid #dce0ec!important;border-radius:8px!important;padding:8px 12px!important;color:#717a91!important;font:inherit!important;line-height:normal!important;min-height:0!important;box-shadow:none!important}
body:is(.mobile-public,.mobile-member,.saas-auth) .upmate-footer-inner{gap:12px}
@media(max-width:767px){html:has(body.saas-auth){scrollbar-gutter:auto}body.saas-auth>header.site-header{height:auto!important;min-height:60px!important;padding:12px 14px!important;gap:10px!important}body.saas-auth>header .site-nav a{font-weight:700!important;font-size:11px!important;min-height:54px;padding:4px 1px!important}body.saas-auth>header .site-nav a.selected,body.saas-auth>header .site-nav:has(#navSignup.selected) #navLogin{color:#5658e8!important;background:#eff4ff!important}}
