/* Profile photo + account dropdown v5.3 */
.profile-menu-wrap{position:relative;display:inline-flex;align-items:center}.profile-menu-toggle{border:0;background:transparent;cursor:pointer;text-align:left;color:inherit;gap:10px;padding:5px 8px;border-radius:12px}.profile-menu-toggle:hover,.profile-menu-toggle[aria-expanded="true"]{background:#eef6f8}.profile-avatar{width:42px;height:42px;min-width:42px;overflow:hidden;display:grid;place-items:center;border-radius:50%;background:linear-gradient(135deg,#137f91,#1ab5ad);color:#fff;font-weight:800}.profile-avatar img{width:100%;height:100%;object-fit:cover;display:block}.profile-name-block{display:grid;gap:3px}.profile-name-block b{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-chevron{font-size:17px;color:#64748b}.profile-menu-dropdown{position:absolute;z-index:1000;right:0;top:calc(100% + 9px);width:230px;padding:8px;border:1px solid #dce6ee;border-radius:14px;background:#fff;box-shadow:0 18px 45px #16324b22}.profile-menu-dropdown[hidden]{display:none!important}.profile-menu-heading{display:grid;gap:3px;padding:12px;border-bottom:1px solid #edf1f5;margin-bottom:5px}.profile-menu-heading b{color:#1d334b;font-size:.88rem}.profile-menu-heading small{color:#718197;font-size:.75rem}.profile-menu-dropdown>a{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:9px;color:#42566c;text-decoration:none;font-size:.84rem;font-weight:650}.profile-menu-dropdown>a:hover{background:#eef7f8;color:#116f80}.profile-menu-dropdown>a.profile-menu-logout{border-top:1px solid #edf1f5;margin-top:5px;padding-top:13px;color:#b42318}.member-profile-photo-row{display:flex;align-items:center;gap:18px;padding:18px 0 24px;margin-bottom:22px;border-bottom:1px solid #e7edf2}.member-profile-photo-preview{width:104px;height:104px;flex:0 0 104px;border-radius:50%;overflow:hidden;display:grid;place-items:center;border:4px solid #e8f5f6;background:linear-gradient(135deg,#177e91,#20b7ae);color:#fff;font-size:2.4rem;font-weight:800}.member-profile-photo-preview img{width:100%;height:100%;object-fit:cover}.member-profile-photo-info{min-width:0}.member-profile-photo-info>strong{font-size:1rem;color:#203850}.member-profile-photo-info p{margin:6px 0 12px}.member-avatar-upload,.member-avatar-remove{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.member-avatar-upload input[type=file]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.member-avatar-upload input[type=file]:focus-visible+button,.member-avatar-upload input[type=file]:focus-visible{outline:2px solid #16869a}.member-avatar-upload label{cursor:pointer}.member-avatar-remove{margin-top:9px}.member-avatar-remove .btn{color:#b42318}.member-profile-panel .form-grid{margin-top:8px}@media(max-width:720px){.profile-name-block,.profile-chevron{display:none}.profile-menu-dropdown{right:-45px;width:min(250px,calc(100vw - 28px))}.member-profile-photo-row{align-items:flex-start;gap:14px}.member-profile-photo-preview{width:82px;height:82px;flex-basis:82px}.member-avatar-upload{align-items:stretch;flex-direction:column}.member-avatar-upload .btn{justify-content:center}}

/* v5.3.1: normalize uploaded profile photo size in the top header only */
.topbar .profile-menu-wrap{flex:0 0 auto;min-width:0}
.topbar .profile-menu-toggle{display:flex;align-items:center;min-width:0;max-width:min(320px,42vw);box-sizing:border-box}
.topbar .profile-menu-toggle .profile-avatar,
.topbar .profile-menu-toggle .avatar.profile-avatar{
  display:block!important;position:relative!important;flex:0 0 40px!important;
  width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;
  max-width:40px!important;max-height:40px!important;padding:0!important;margin:0!important;
  overflow:hidden!important;border-radius:50%!important;aspect-ratio:1/1!important;
  line-height:40px!important;box-sizing:border-box!important;
}
.topbar .profile-menu-toggle .profile-avatar img{
  display:block!important;position:absolute!important;inset:0!important;
  width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
  max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:center!important;
  border:0!important;border-radius:50%!important;padding:0!important;margin:0!important;
}
.topbar .profile-name-block{min-width:0;max-width:170px}
.topbar .profile-name-block b,.topbar .profile-name-block small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){.topbar .profile-menu-toggle{max-width:54px;padding:5px}.topbar .profile-menu-toggle .profile-avatar,.topbar .profile-menu-toggle .avatar.profile-avatar{flex-basis:38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;line-height:38px!important}}


/* v5.3.2: keep uploaded avatar fully inside the header bounds */
.topbar{min-width:0;box-sizing:border-box}
.topbar .top-actions{min-width:0;max-width:100%;box-sizing:border-box}
.topbar .profile-menu-wrap{min-width:0;max-width:100%;overflow:visible}
.topbar .profile-menu-toggle{height:50px;max-height:50px;overflow:hidden;align-self:center;flex:0 1 auto}
.topbar .profile-menu-toggle .profile-avatar,
.topbar .profile-menu-toggle .avatar.profile-avatar{flex-shrink:0!important;align-self:center!important;vertical-align:middle!important}
.topbar .profile-menu-toggle .profile-avatar img{object-fit:cover!important;clip-path:circle(50% at 50% 50%)}
@media(max-width:760px){
  .topbar{gap:8px}
  .topbar .top-actions{gap:6px}
  .topbar .profile-menu-wrap{align-self:center}
  .topbar .profile-menu-toggle{height:46px;max-height:46px;min-height:46px;padding:4px;overflow:hidden}
}

/* v5.3.3: robust responsive avatar sizing in header and profile editor */
.profile-avatar,
.profile-avatar.avatar,
.member-profile-photo-preview {
  position:relative;
  box-sizing:border-box;
  aspect-ratio:1 / 1;
  max-width:100%;
  padding:0;
  isolation:isolate;
}
.profile-avatar,
.profile-avatar.avatar {
  width:clamp(32px, 3vw, 42px) !important;
  height:clamp(32px, 3vw, 42px) !important;
  min-width:clamp(32px, 3vw, 42px) !important;
  min-height:clamp(32px, 3vw, 42px) !important;
  max-width:42px !important;
  max-height:42px !important;
  overflow:hidden !important;
  border-radius:50% !important;
  line-height:1 !important;
}
.profile-avatar img,
.member-profile-photo-preview img {
  position:absolute;
  inset:0;
  display:block;
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:100% !important;
  max-height:100% !important;
  object-fit:cover !important;
  object-position:center !important;
  border-radius:inherit !important;
  padding:0 !important;
  margin:0 !important;
}
.topbar {min-height:68px; height:auto; max-width:100%; overflow:visible; align-items:center}
.topbar .top-actions {display:flex; align-items:center; min-width:0; flex-shrink:1}
.topbar .profile-menu-wrap {display:flex; align-items:center; min-width:0; flex-shrink:1}
.topbar .profile-menu-toggle {display:flex; align-items:center; min-height:48px; height:auto; max-height:54px; max-width:min(320px, 40vw); overflow:hidden; flex-shrink:1}
.topbar .profile-menu-toggle .profile-avatar {flex:0 0 40px !important}
.topbar .profile-name-block {min-width:0; overflow:hidden}
.topbar .profile-name-block b,.topbar .profile-name-block small {max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
@media(max-width:760px) {
  .topbar {min-height:60px; gap:6px; padding-inline:12px;}
  .topbar .top-actions {gap:4px;}
  .topbar .profile-menu-toggle {min-height:44px; height:44px; max-height:44px; width:48px; max-width:48px; padding:3px; justify-content:center;}
  .topbar .profile-menu-toggle .profile-avatar {flex:0 0 36px !important; width:36px !important; height:36px !important; min-width:36px !important; min-height:36px !important; max-width:36px !important; max-height:36px !important;}
  .topbar .profile-name-block,.topbar .profile-chevron {display:none !important}
  .topbar .profile-menu-dropdown {right:0; left:auto; max-width:calc(100vw - 24px);}
  .member-profile-photo-preview {width:clamp(68px, 20vw, 88px); height:auto; aspect-ratio:1/1; flex:0 0 clamp(68px, 20vw, 88px);}
}
@media(prefers-reduced-motion:reduce) {.profile-avatar img,.member-profile-photo-preview img {transition:none !important}}


/* v5.3.4: ensure the profile avatar stylesheet is loaded on authenticated app pages. Scope image sizing to the avatar and prevent page-level image rules from affecting it. */
.app-shell .topbar .profile-menu-wrap{display:flex!important;align-items:center!important;position:relative!important;flex:0 0 auto!important;min-width:0!important;max-width:100%!important}
.app-shell .topbar .profile-menu-toggle{display:flex!important;align-items:center!important;gap:10px!important;box-sizing:border-box!important;max-height:54px!important;min-height:48px!important;overflow:visible!important}
.app-shell .topbar .profile-menu-toggle .profile-avatar{position:relative!important;display:block!important;flex:0 0 40px!important;width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;max-width:40px!important;max-height:40px!important;overflow:hidden!important;border-radius:50%!important;aspect-ratio:1/1!important;box-sizing:border-box!important}
.app-shell .topbar .profile-menu-toggle .profile-avatar img{position:absolute!important;inset:0!important;display:block!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;object-fit:cover!important;object-position:center!important;border-radius:inherit!important;margin:0!important;padding:0!important}
.app-shell .topbar .profile-menu-toggle .profile-name-block{display:grid!important;min-width:0!important;max-width:170px!important;overflow:hidden!important}
.app-shell .topbar .profile-menu-toggle .profile-name-block b,.app-shell .topbar .profile-menu-toggle .profile-name-block small{display:block!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
@media(max-width:760px){.app-shell .topbar .profile-menu-toggle{width:48px!important;max-width:48px!important;min-width:48px!important;min-height:44px!important;height:44px!important;max-height:44px!important;padding:3px!important;justify-content:center!important;overflow:visible!important}.app-shell .topbar .profile-menu-toggle .profile-avatar{flex-basis:36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;max-width:36px!important;max-height:36px!important}.app-shell .topbar .profile-menu-toggle .profile-name-block,.app-shell .topbar .profile-menu-toggle .profile-chevron{display:none!important}}
