.profile-menu { position:relative; }
.profile-menu>summary { display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;list-style:none;border-radius:10px;padding:3px 5px;color:var(--nk-black); }
.profile-menu>summary::-webkit-details-marker { display:none; }
.profile-menu>summary:hover { background:var(--nk-gray-100); }
.profile-avatar { width:42px;height:42px;object-fit:cover;border:1px solid var(--nk-gray-300);border-radius:50%;background:var(--nk-gray-100);flex:none; }
.profile-identity { display:grid;max-width:220px;line-height:1.3; }
.profile-identity strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px; }
.profile-identity small { font-size:12px;color:var(--nk-gray-600); }
.profile-chevron { width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7; }
.profile-menu-options { position:absolute;right:0;top:calc(100% + 10px);z-index:55;min-width:190px;padding:6px;border:1px solid var(--nk-gray-300);border-radius:12px;background:var(--nk-surface);box-shadow:var(--nk-shadow); }
.profile-menu-options button { display:block;width:100%;text-align:left;min-height:44px;border:0;background:transparent;color:var(--nk-black); }
.profile-menu-options button:hover { background:var(--nk-gray-100); }
.profile-menu-options form { margin:0;border-top:1px solid var(--nk-gray-200); }
.profile-dialog { width:min(600px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--nk-gray-300);border-radius:18px;background:var(--nk-surface);color:var(--nk-black);overflow:auto;box-shadow:0 24px 80px #0007; }
.profile-dialog::backdrop { background:#000a; }
body.profile-dialog-open { overflow:hidden; }
.profile-dialog-heading { position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px 22px;border-bottom:1px solid var(--nk-gray-200);background:var(--nk-surface); }
.profile-dialog-heading h2 { font-size:23px;margin:0; }.profile-dialog-heading p { font-size:13px;margin:4px 0 0; }
button.profile-close { width:40px;min-height:40px;padding:4px;font-size:26px; }
#profile-form { padding:18px 22px 0; }.profile-dialog fieldset { border:0;padding:0;margin:0;min-width:0; }
.profile-sr-only { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
.profile-photo-row { display:flex;gap:16px;align-items:center; }
.profile-preview { width:88px;height:88px;object-fit:cover;border-radius:50%;border:1px solid var(--nk-gray-300);background:var(--nk-gray-100);flex:none; }
.profile-dropzone { flex:1;min-width:0;padding:14px;border:1px dashed var(--nk-gray-400);border-radius:12px;background:var(--nk-gray-100); }
.profile-dropzone.is-dragover { outline:2px solid var(--nk-red);background:var(--nk-red-soft); }
.profile-photo-label { cursor:pointer;font-size:14px;margin:0;text-decoration:underline; }.profile-dropzone span { display:block;font-size:12px;margin-top:6px; }
#profile-photo { width:100%;font-size:12px;margin-top:8px;min-height:34px;padding:3px;border:0;background:transparent; }
.profile-photo-help,.profile-file-name { font-size:12px;margin:10px 0;overflow-wrap:anywhere; }
.profile-avatar-choices legend { font-size:14px;font-weight:700;margin-bottom:10px; }
.profile-avatar-grid { display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:7px; }
button.profile-avatar-option { min-width:0;min-height:0;padding:3px;border:2px solid transparent;background:var(--nk-gray-100);border-radius:12px; }
.profile-avatar-option img { display:block;width:100%;height:auto;border-radius:8px; }
button.profile-avatar-option[aria-pressed="true"] { border-color:var(--nk-red);outline:1px solid var(--nk-red); }
.profile-name-fields { display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:12px; }
.profile-name-fields label { margin:0; }
#profile-email { background:var(--nk-gray-100);cursor:default; }
.profile-email-help { display:block;margin-top:-4px;font-size:12px; }
.profile-dialog-actions { position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:16px 0;background:var(--nk-surface);margin-top:14px;border-top:1px solid var(--nk-gray-200); }
#profile-feedback:not(:empty) { padding:10px 12px;margin-bottom:14px;border-left:3px solid var(--nk-red);background:var(--nk-red-soft);border-radius:7px;font-size:14px; }
.profile-toast { position:fixed;z-index:90;bottom:20px;right:20px;max-width:calc(100vw - 32px);padding:12px 18px;border:1px solid var(--nk-gray-300);border-left:4px solid var(--nk-red);border-radius:10px;background:var(--nk-surface);color:var(--nk-black);box-shadow:var(--nk-shadow); }
@media(max-width:760px) {
 .profile-menu>summary { gap:5px;padding:0; }.profile-avatar { width:36px;height:36px; }
 .profile-identity { max-width:90px; }.profile-identity strong { font-size:12px; }.profile-identity small,.profile-chevron { display:none; }
 .profile-dialog-heading { padding:14px; }#profile-form { padding:14px 14px 0; }.profile-dialog-heading h2 { font-size:20px; }
 .profile-photo-row { gap:10px; }.profile-preview { width:64px;height:64px; }.profile-dropzone { padding:10px; }
 .profile-avatar-grid { grid-template-columns:repeat(4,minmax(0,1fr));gap:8px; }.profile-avatar-option img { max-width:56px;margin:auto; }
 .profile-name-fields { grid-template-columns:1fr;gap:8px; }.profile-dialog-actions button { flex:1; }
}
@media(max-width:360px) { .profile-identity { max-width:62px; }.profile-avatar { width:32px;height:32px; }.profile-menu>summary { gap:3px; } }
