.profile-status{min-height:28px;padding:5px 28px;display:flex;gap:15px;align-items:center;justify-content:flex-end;background:#f5f4ee;color:#62665e;font-size:11px;border-bottom:1px solid var(--line,#e6e3da)}
.profile-status[data-error=true]{background:#fff2df;color:#8c4526;justify-content:center}.profile-status button{border:0;background:none;text-decoration:underline;font:inherit;cursor:pointer}
.profile-button{width:100%;text-align:left;background:transparent;border:0;color:inherit;cursor:pointer}.profile-button small{display:block;font-size:11px;color:#797b74;margin-top:3px}
#profile-dialog{width:min(420px,calc(100vw - 40px));padding:32px;border:1px solid #dcd8cf;border-radius:8px;color:#30332e;background:#fffef9;box-shadow:0 20px 70px #0002}
#profile-dialog::backdrop{background:#2227}#profile-dialog h2{font-size:22px;margin:0 0 10px}#profile-dialog p{font-size:13px;color:#6d7067;line-height:1.65}
#profile-dialog form[data-profile-auth]{display:grid;gap:16px;margin:24px 0 12px}#profile-dialog label,[data-profile-name] label{display:grid;gap:8px;font-size:12px;font-weight:600}
#profile-dialog input,[data-profile-name] input{font:inherit;padding:12px;border:1px solid #d8d6cb;border-radius:4px;background:white;color:#30332e}
.profile-password{display:grid;gap:8px}.profile-password-row{display:flex;gap:8px;min-width:0}
#account-recovery-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;padding:30px;border:1px solid var(--line);border-radius:10px;background:var(--paper,#fffef9);color:var(--ink);box-shadow:0 20px 70px #0002}
#account-recovery-dialog::backdrop{background:#2227}
#account-recovery-dialog h2{font-size:20px;margin:0 0 12px}
#account-recovery-dialog p{font-size:13px;color:var(--muted);line-height:1.7}
#account-recovery-dialog form:not([method=dialog]),[data-account-email]{display:grid;gap:16px;margin:22px 0 14px;max-width:380px}
#account-recovery-dialog label,[data-account-email] label{display:grid;gap:8px;font-size:12px;font-weight:600}
#account-recovery-dialog input,[data-account-email] input{width:100%;min-width:0;padding:12px;border:1px solid var(--line);border-radius:5px;background:var(--paper,#fffef9);color:var(--ink);font:inherit;font-size:13px}
#account-recovery-dialog .profile-password-row input,[data-account-email] .profile-password-row input{flex:1}
#account-recovery-dialog [data-password-toggle],[data-account-email] [data-password-toggle]{min-width:54px;padding:0 10px;border:1px solid var(--line);border-radius:5px;font-size:12px;color:var(--ink)}
.account-recovery-links{display:flex;align-items:center;gap:12px;margin:18px 0;color:var(--muted);font-size:12px}
.account-recovery-links button{font:inherit;color:var(--accent)}
.account-email-status{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0;font-size:13px}
.account-email-status b{font-weight:500;overflow-wrap:anywhere}.account-email-status span{color:var(--muted);font-size:11px}
.account-email-edit summary{font-size:13px;color:var(--accent);cursor:pointer}
.account-service-note{font-size:12px;line-height:1.7;color:var(--muted);padding:12px 14px;border:1px solid var(--line);border-radius:5px;margin:16px 0}
#account-recovery-dialog .button:disabled,[data-account-email] .button:disabled{opacity:.5;cursor:not-allowed}
#profile-dialog label{text-align:left}
#profile-dialog .profile-password-row input{flex:1;min-width:0;font-size:13px}
#profile-dialog [data-password-toggle]{min-width:58px;min-height:44px;padding:0 10px;border:1px solid #d8d6cb;border-radius:4px;background:#f7f6ef;color:#45483f;font:inherit;font-size:12px;cursor:pointer}
#profile-dialog [data-password-toggle]:focus-visible{outline:2px solid #863744;outline-offset:2px}
[data-profile-username]{max-width:360px;display:grid;gap:14px;margin:20px 0 0}
[data-profile-username] label{display:grid;gap:8px;font-size:12px;font-weight:600;text-align:left}
[data-profile-username] input{min-width:0;font:inherit;font-size:13px;padding:12px;border:1px solid #d8d6cb;border-radius:4px;background:white;color:#30332e}
[data-profile-username] .profile-password-row input{flex:1}
[data-profile-username] [data-password-toggle]{min-width:58px;min-height:44px;padding:0 10px;border:1px solid #d8d6cb;border-radius:4px;background:#f7f6ef;color:#45483f;font:inherit;font-size:12px;cursor:pointer}
[data-profile-username] [data-password-toggle]:focus-visible{outline:2px solid #863744;outline-offset:2px}
[data-profile-username] [role=status]{font-size:12px;line-height:1.6;margin:0}
[data-profile-username] [data-error=true]{color:#a23736}
#profile-dialog .profile-close{position:absolute;right:15px;top:12px;background:none;border:0;font-size:24px;cursor:pointer}#profile-dialog small{display:block;margin-top:20px;font-size:11px;color:#777}
#profile-dialog .profile-form-error{margin:0;color:#a23736}#profile-dialog .text-link{margin-top:12px}[data-profile-name]{max-width:360px;display:grid;gap:14px;margin:20px 0}
@media(max-width:700px){.profile-status{padding:7px 14px;justify-content:flex-start;flex-wrap:wrap}}
.avatar{overflow:hidden;flex-shrink:0}.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar.profile-avatar-large{width:64px;height:64px;min-width:64px;border-radius:50%;display:grid;place-items:center;font-size:22px;background:#ede8dc;color:#6d544e}
.profile-summary{display:flex;gap:18px;align-items:center;padding:22px 0 16px;flex-wrap:wrap}
.profile-summary>div{flex:1;min-width:100px}.profile-summary h3{font-size:17px;font-weight:600;margin:0;overflow-wrap:anywhere}
.profile-summary p{font-size:12px;color:var(--muted);margin:7px 0 0}.profile-summary .button{font-size:12px}
#profile-editor-dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:28px;border-radius:8px;background:#fffef9}
#profile-editor-dialog h2{font-size:20px;margin:0 0 24px}
#profile-editor-dialog form{text-align:left}#profile-editor-dialog fieldset{border:0;margin:0;padding:0;display:grid;gap:22px;min-width:0}
.profile-photo-editor{display:flex;gap:18px;align-items:center}.profile-photo-editor>div:last-child{flex:1;min-width:0}
.profile-photo-editor .button,.profile-photo-editor .text-link{font-size:12px}.profile-photo-editor .text-link{margin-left:12px}
#profile-editor-dialog .profile-photo-editor p{font-size:11px;color:var(--muted);margin:8px 0 0}
.profile-photo-pick{position:relative;overflow:hidden;cursor:pointer}.profile-photo-pick input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.profile-photo-pick:focus-within{outline:2px solid var(--accent);outline-offset:3px}
.profile-edit-label{display:grid;gap:8px;font-size:12px;font-weight:600;text-align:left;min-width:0}
.profile-edit-label input,.profile-edit-label select{width:100%;min-height:44px;min-width:0;padding:10px 12px;border:1px solid #d8d6cb;border-radius:4px;background:white;color:#30332e;font:inherit;font-size:14px}
.profile-grade-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}
#profile-editor-dialog .profile-editor-message{font-size:12px;line-height:1.6;margin:0;color:#7b3943}.profile-editor-message:empty{display:none}
.profile-editor-actions{display:flex;gap:10px;justify-content:flex-end;padding-top:6px;border-top:1px solid var(--line)}.profile-editor-actions .button{min-width:84px}
.shell[hidden],.login-gate[hidden]{display:none!important}
.auth-pending .prototype a,.auth-required .prototype a{display:none}
.login-gate{max-width:460px;margin:clamp(60px,16vh,170px) auto;padding:36px 28px;text-align:center;color:var(--ink,#30332e)}
.login-gate h1{font-size:26px;margin:0 0 18px}.login-gate p{font-size:14px;line-height:1.8;color:var(--muted,#6d7067);margin:0 0 24px}.login-gate .button{min-width:140px}
.profile-dialog-actions{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-4,16px);margin-top:var(--space-6,24px)}
.profile-dialog-actions>.button{margin:0}
