.profile-avatar-block[data-profile-avatar-root] {
  cursor: pointer;
}

.profile-avatar-block {
  display: inline-block;
  border: none;
  background: none;
  padding: 0;
  text-align: inherit;
}

.profile-avatar-block__ring {
  position: relative;
  display: block;
}

.profile-avatar-block__img,
.profile-avatar-block__initials {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  object-fit: cover;
  display: block;
}

.profile-avatar-block__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.15rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #0066cc, #4f46e5);
}

.profile-avatar-block__camera {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #0f172a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  z-index: 20;
}

.profile-avatar-block--sm .profile-avatar-block__img,
.profile-avatar-block--sm .profile-avatar-block__initials {
  width: 88px;
  height: 88px;
  font-size: 1.6rem;
}

.profile-avatar-block--md .profile-avatar-block__img,
.profile-avatar-block--md .profile-avatar-block__initials {
  width: 96px;
  height: 96px;
  font-size: 1.75rem;
}

.profile-public-header__avatar-row .profile-avatar-block {
  margin-top: 0;
}

body.profile-avatar-modal-open {
  overflow: hidden;
}

.profile-avatar-modal[hidden] {
  display: none !important;
}

.profile-avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.profile-avatar-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.profile-avatar-modal__dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.profile-avatar-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.profile-avatar-modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.profile-avatar-modal__close {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: #64748b;
}

.profile-avatar-modal__body {
  padding: 16px;
}

.profile-avatar-modal__preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.profile-avatar-modal__preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 12px;
  object-fit: contain;
}

.profile-avatar-modal__initials {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #0066cc, #4f46e5);
}

.profile-avatar-modal__crop-box {
  max-height: 360px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
}

.profile-avatar-modal__crop-box img {
  display: block;
  max-width: 100%;
}

.profile-avatar-modal__crop-hint {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.profile-avatar-modal__status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: #0f766e;
}

.profile-avatar-modal__status--error {
  color: #b91c1c;
}

.profile-avatar-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.profile-avatar-modal__actions.is-hidden,
.profile-avatar-modal__view.is-hidden,
.profile-avatar-modal__crop.is-hidden,
.profile-avatar-modal__btn.is-hidden {
  display: none !important;
}

.profile-avatar-modal__btn {
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}

.profile-avatar-modal__btn--ghost {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #334155;
}

.profile-avatar-modal__btn--primary {
  background: #0066cc;
  color: #fff;
}

.profile-avatar-modal__btn--danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
  margin-right: auto;
}

.profilo-sidebar-avatar {
  display: flex;
  justify-content: center;
}

.nav-notifs-subpanel__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 991px) {
  .profile-avatar-modal {
    align-items: flex-end;
    padding: 0;
  }

  .profile-avatar-modal__dialog {
    width: 100%;
    max-width: none;
    max-height: min(94vh, 100%);
    border-radius: 16px 16px 0 0;
  }

  .profile-avatar-modal__crop-box {
    max-height: min(52vh, 400px);
  }

  .profile-avatar-modal__actions {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

.profile-avatar-chooser {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.profile-avatar-chooser__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
}
.profile-avatar-chooser__sheet {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  margin: 0 12px 16px;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-avatar-chooser__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}
.profile-avatar-chooser__btn:hover {
  background: #f1f5f9;
}
.profile-avatar-chooser__btn--muted {
  color: #64748b;
  font-weight: 600;
}
