/* Profile view and personal identity. Keep project controls compact. */
.app-header .group-badge:not(.is-guest){height:auto;min-height:42px;max-width:clamp(180px,22vw,300px);overflow:visible;padding:5px 9px;white-space:normal;flex:0 1 auto}
.group-badge-text{display:grid;min-width:0;gap:3px;text-align:left}
.app-header .group-badge .group-badge-name{display:block;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;font-size:clamp(11px,.95vw,13px);line-height:1.25}
.group-badge-context{display:flex;gap:5px;align-items:center;color:#668277;font-size:10px;line-height:1.2;overflow-wrap:anywhere}
.app-header .group-badge-context .group-context-picture{width:16px;height:16px;min-width:16px;flex:0 0 16px;border-radius:5px;font-size:9px}
.app-header:has(.group-badge:not(.is-guest)){height:auto;min-height:68px}
.project-room.is-profile #roomWorkspace>.room-identity,.project-room.is-profile #roomWorkspace>.dashboard-layout{display:none}
.project-room #profileSettings{box-sizing:border-box;width:100%;max-width:960px;margin:0 auto 16px;padding:0;border:1px solid #dce3ee;border-radius:22px;overflow:hidden;background:#fff;box-shadow:0 5px 0 #e9edf5;color:#34435c}
#profileSettings .profile-panel-heading{display:flex;align-items:center;gap:14px;padding:14px 20px;border-bottom:1px solid #e5eaf2;background:#fbfcff}
#profileSettings .profile-panel-heading h2{margin:0;font-size:18px;font-weight:700;color:#34435c}
#profileSettings .profile-back{display:flex;align-items:center;gap:6px;min-height:40px;padding:7px 11px;background:#fff;border:1px solid #d8e0ed;border-radius:11px;color:#586e8c;font:650 13px var(--font);cursor:pointer}
#profileSettings .profile-back .icon-svg{width:22px;height:22px}
#profileSettings .profile-hero{display:flex;align-items:center;gap:24px;padding:24px 28px;background:linear-gradient(115deg,#f1f7ff,#fff 65%);border-bottom:1px solid #e5eaf2}
#profileSettings .profile-photo-controls{display:flex;align-items:center;flex-direction:column;gap:5px;flex:0 0 100px}
#profileSettings #profilePhotoPick{position:relative;display:block;width:96px;height:96px;margin:0;padding:0;border:3px solid #fff;border-radius:27px;background:#e9effb;box-shadow:0 0 0 1px #cad8ef,0 5px 0 #e1e8f4;cursor:pointer}
#profileSettings #profilePicture{display:grid;place-items:center;overflow:hidden;width:100%;height:100%;border-radius:23px;background:#e7eefb;color:#617bae;font-size:36px;font-weight:700}
#profileSettings #profilePicture img{width:100%;height:100%;object-fit:cover}
#profileSettings .profile-photo-edit{position:absolute;right:-9px;bottom:-3px;display:grid;place-items:center;width:29px;height:29px;padding:4px;box-sizing:border-box;border:2px solid #fff;border-radius:10px;background:#e4ddff}
#profileSettings .profile-photo-edit .icon-svg{width:22px;height:22px}
#profileSettings .profile-remove-photo{padding:6px 9px;min-height:32px;background:none;border:0;color:#8b6e84;font:500 11px var(--font);cursor:pointer}
#profileSettings .profile-hero-info{display:grid;gap:9px;min-width:0}
#profileSettings #profileDisplayName{font-size:clamp(20px,2.3vw,28px);line-height:1.2;font-weight:700;overflow-wrap:anywhere;color:#33465f}
#profileSettings .profile-role{justify-self:start;border-radius:8px;background:#e4f4ed;color:#358066;padding:5px 10px;font-size:12px;font-weight:650}
#profileSettings #accountProfileForm,#profileSettings #groupSettingsForm{display:block;margin:0;padding:22px 26px 20px}
#profileSettings .profile-content-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px;align-items:start}
#profileSettings .profile-main-fields{display:grid;gap:18px}
#profileSettings .profile-section{min-width:0;margin:0;padding:17px;border:1px solid #dce3ee;border-radius:15px;background:#fff}
#profileSettings .profile-section legend{width:auto;padding:0 7px;font-size:14px;font-weight:700;color:#4e6785;letter-spacing:0;text-transform:none}
#profileSettings .profile-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0}
#profileSettings label{display:grid;gap:7px;margin:0 0 14px;font-size:12px;font-weight:600;color:#697a91}
#profileSettings .profile-fields>label{margin:0}
#profileSettings input,#profileSettings select{box-sizing:border-box;display:block;width:100%;min-width:0;min-height:44px;margin:0;padding:10px 12px;border:1px solid #d4deed;border-radius:10px;background:#fbfcff;color:#34465d;font:500 14px var(--font);box-shadow:none}
#profileSettings input:focus,#profileSettings select:focus{outline:3px solid #dbe8fc;outline-offset:1px;border-color:#8fafd6;background:#fff}
#profileSettings .school-fields{margin:0;gap:12px}
.school-field-content .school-logo{box-sizing:border-box;display:grid;place-items:center;flex:0 0 110px;width:110px;min-height:76px;border:1px solid #e4e8ef;border-radius:11px;background:#fff;padding:8px}
.school-field-content .school-logo img{display:block;width:100%;height:64px;object-fit:contain}
.school-field-content{align-items:center;min-width:0}
#profileSettings .school-field-content{flex-wrap:wrap;gap:10px}
#profileSettings .school-field-content>input{flex:1 1 150px;width:auto}
#profileSettings .school-input-row>label{margin-bottom:8px}
#profileSettings .school-input-row .school-remove{min-height:40px;height:40px;flex-basis:36px}
#profileSettings .profile-login-settings{margin-top:18px;border-top:1px solid #e5eaf2;padding:14px 0 0;background:none;box-shadow:none}
#profileSettings .profile-login-settings summary{font-size:12px;font-weight:650;color:#627d9d;cursor:pointer;padding:4px 0;min-height:24px}
#profileSettings .profile-login-settings[open] summary{margin-bottom:12px}
#profileSettings #profileCurrentPasswordField{margin-top:14px}
#profileSettings .profile-save-row{display:flex;justify-content:flex-end;margin-top:22px;padding-top:16px;border-top:1px solid #e5eaf2}
#profileSettings .profile-save-row>.room-primary{display:flex;align-items:center;justify-content:center;gap:8px;width:auto;min-height:44px;margin:0;padding:9px 20px;border:1px solid #369d86;border-radius:12px;background:#249980;box-shadow:0 3px 0 #177a68;color:#fff;font:650 14px var(--font);cursor:pointer}
#profileSettings .profile-save-row>.room-primary .icon-svg{width:24px;height:24px}
#profileSettings [hidden],.group-badge [hidden]{display:none!important}
@media(max-width:760px){
 .app-header .group-badge:not(.is-guest){max-width:210px}
 #profileSettings .profile-hero{padding:20px;gap:18px}
 #profileSettings .profile-content-grid{grid-template-columns:1fr}
 #profileSettings #accountProfileForm,#profileSettings #groupSettingsForm{padding:18px}
}
@media(max-width:520px){
 .app-header:has(.group-badge:not(.is-guest)){grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:auto auto;gap:6px 7px;min-height:0;padding:7px 10px}
 .app-header:has(.group-badge:not(.is-guest)) .brand{grid-column:1/3;grid-row:1}
 .app-header:has(.group-badge:not(.is-guest)) .header-actions{grid-column:3;grid-row:1}
 .app-header:has(.group-badge:not(.is-guest)) .project-heading{grid-column:1;grid-row:2;height:auto!important;min-width:60px}
 .app-header .group-badge:not(.is-guest){grid-column:2/4;grid-row:2;max-width:57vw;height:auto;min-height:36px;gap:6px;padding:4px 7px;font-size:11px}
 .app-header .group-badge:not(.is-guest)>.identity-picture{width:28px;height:28px;min-width:28px;flex-basis:28px}
 #profileSettings .profile-panel-heading{padding:12px;gap:12px}
 #profileSettings .profile-panel-heading h2{font-size:16px}
 #profileSettings .profile-hero{gap:16px;padding:18px 14px}
 #profileSettings .profile-photo-controls{flex-basis:80px}
 #profileSettings #profilePhotoPick{width:76px;height:76px;border-radius:22px}
 #profileSettings #profilePicture{border-radius:18px}
 #profileSettings #profileDisplayName{font-size:21px}
 #profileSettings #accountProfileForm,#profileSettings #groupSettingsForm{padding:14px}
 #profileSettings .profile-section{padding:14px}
 #profileSettings .profile-fields{gap:14px 10px}
 #profileSettings input,#profileSettings select{font-size:16px;padding:9px 10px}
 #profileSettings .profile-save-row>.room-primary{width:100%}
 .school-field-content .school-logo{flex-basis:90px;width:90px}
}
/* Let a school's full title wrap beside its real logo. */
.school-field-content .school-logo{flex:1 0 100%;width:100%;display:flex;align-items:center;gap:14px;min-height:108px;text-align:left}
.school-field-content .school-logo img{width:62px;height:90px;flex:0 0 62px}
.school-field-content .school-logo strong{font-size:13px;line-height:1.45;font-weight:650;color:#536880;overflow-wrap:anywhere}
.school-input-row>.school-field-content{flex-wrap:wrap}
#profileSettings .school-input-row>label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#profileSettings .school-field-content>input{flex-basis:calc(100% - 52px)}
/* School identity belongs beside the person; the form below stays compact. */
#profileSettings .profile-hero{gap:20px;padding:20px 26px}
#profileSettings .profile-hero-info{flex:1 1 auto}
#profileSettings .profile-school-summary{display:flex;align-items:center;gap:10px;flex:0 1 270px;min-width:0;padding:10px 12px;border:1px solid #dce5ed;border-radius:14px;background:#fff}
#profileSettings .profile-school-summary strong{font-size:13px;line-height:1.45;color:#546b80;font-weight:650;overflow-wrap:anywhere}
.school-logo-square{box-sizing:border-box;display:grid;place-items:center;width:52px;height:52px;flex:0 0 52px;overflow:hidden;border:1px solid #e0e6ef;border-radius:12px;background:#fff;color:#63809b;font-size:21px;font-weight:650;padding:4px}
.school-logo-square img{display:block;width:100%;height:100%;object-fit:contain}
#profileSettings .profile-role-field{margin:0;justify-self:start;max-width:190px}
#profileSettings #profileAccountRole{min-height:34px;width:auto;max-width:100%;padding:5px 28px 5px 10px;border:1px solid #c4dfd2;border-radius:9px;background-color:#e9f6ef;color:#367c65;font-size:13px;font-weight:650}
#profileSettings .profile-login-settings{min-width:0;margin:18px 0 0;padding:15px 0 0;border:0;border-top:1px solid #e1e8f1;border-radius:0}
#profileSettings .profile-login-settings legend{padding:0 7px 0 0;font-size:13px;line-height:1.4;font-weight:650;color:#627993}
#profileSettings .profile-login-settings label:last-child{margin-bottom:0}
#profileSettings #profileCurrentPasswordField{margin-top:0}
#profileSettings .school-logo{display:none!important}
#profileSettings .school-fields{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
#profileSettings .school-input-row{flex:1 0 100%;min-width:0}
#profileSettings .school-field-content{flex-wrap:nowrap;gap:7px}
#profileSettings .school-field-content>input{flex:1 1 auto;width:0}
.school-create,.school-image-edit{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:7px 10px;border:1px solid #d4dfec;border-radius:10px;background:#f1f6fc;color:#5c7695;font:600 12px var(--font);cursor:pointer}
.school-create .icon-svg{width:22px;height:22px}
.school-image-edit{flex:0 0 38px;width:38px;height:40px;padding:6px}.school-image-edit .icon-svg{width:25px;height:25px}
.school-field-content .school-logo{flex:1 0 100%;min-height:64px;padding:8px 10px}.school-field-content .school-logo>.school-logo-square{width:44px;height:44px;flex-basis:44px}.school-field-content .school-logo>.school-logo-square img{width:100%;height:100%;flex:none}
.school-editor{width:min(480px,94vw);max-height:92dvh;padding:22px;box-sizing:border-box;border:1px solid #d2ddeb;border-radius:22px;background:#fff;color:#415974;box-shadow:0 15px 60px #263a5929;font-family:var(--font)}
.school-editor form{margin:0}.school-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px}.school-editor-heading h2{font-size:21px;margin:0}.school-editor-heading .icon-button{width:38px;height:38px;padding:7px;border-radius:10px;border:1px solid #dae3f0;background:#f7f9fe;cursor:pointer}.school-editor .icon-svg{width:25px;height:25px;flex:0 0 25px}
.school-editor label{display:grid;gap:7px;margin-bottom:16px;font-size:13px;font-weight:600}.school-editor input:not([type=file]),.school-editor select{min-width:0;width:100%;box-sizing:border-box;min-height:44px;border:1px solid #cfdbeb;border-radius:11px;padding:10px 12px;background:#f9fbff;color:#415974;font:500 14px var(--font)}
.school-editor .school-image-pick{display:flex;align-items:center;gap:17px;width:100%;padding:15px;border:1px dashed #bdcde2;border-radius:16px;background:#f8fbff;color:#627d9a;font:600 13px var(--font);text-align:left;cursor:pointer}.school-image-pick>span:last-child{display:flex;align-items:center;gap:6px}.school-editor-preview{display:grid;place-items:center;box-sizing:border-box;flex:0 0 88px;width:88px;height:88px;padding:6px;border:1px solid #dee6ef;border-radius:15px;background:#fff;overflow:hidden}.school-editor-preview img{width:100%;height:100%;object-fit:contain}.school-editor-preview .icon-svg{width:36px;height:36px}
.school-editor-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:15px}.school-editor-actions>button{min-height:44px;display:flex;align-items:center;justify-content:center;gap:7px;padding:9px 15px;border:1px solid #d3deed;border-radius:11px;background:#f6f9ff;color:#617a99;font:650 13px var(--font);cursor:pointer}.school-editor-actions>.room-primary{background:#249980;border-color:#369d86;color:#fff;box-shadow:0 3px 0 #177a68}.school-editor [data-school-message]{min-height:0;font-size:13px;color:#ae4862;line-height:1.5}.school-editor [hidden],.school-fields [hidden]{display:none!important}
@media(max-width:760px){#profileSettings .profile-hero{flex-wrap:wrap;padding:18px;gap:16px}#profileSettings .profile-school-summary{flex:1 0 100%;box-sizing:border-box}#profileSettings .profile-school-summary .school-logo-square{width:46px;height:46px;flex-basis:46px}#profileSettings .profile-school-summary strong{font-size:13px}#profileSettings .profile-save-row{position:sticky;bottom:-14px;background:#fff;padding-bottom:5px;z-index:1}.school-editor input:not([type=file]),.school-editor select{font-size:16px}}
@media(max-width:520px){#profileSettings .profile-hero-info{flex-basis:calc(100% - 110px)}#profileSettings .profile-role-field{max-width:170px}.school-editor{padding:17px}.school-editor-preview{width:72px;height:72px;flex-basis:72px}}
#profileSettings .school-logo-square>img{width:100%;height:100%;max-height:100%;object-fit:contain}
.school-editor .school-editor-preview>img{width:100%;height:100%;max-height:100%;object-fit:contain}
#profileSettings .school-add{min-height:40px;font:600 12px var(--font);border-radius:10px;padding:7px 10px;gap:6px}
#profileSettings .school-add .icon-svg{width:22px;height:22px}
.school-logo-square,.school-editor-preview{position:relative}
#profileSettings .school-logo-square>img,.school-field-content .school-logo>.school-logo-square>img{position:absolute;inset:4px;width:calc(100% - 8px);height:calc(100% - 8px);max-height:none;min-height:0;min-width:0;object-fit:contain}
.school-editor .school-editor-preview>img{position:absolute;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);max-height:none;min-height:0;min-width:0;object-fit:contain}
