.profile-avatar {
  display: grid;
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid #ffffff24;
  border-radius: 30%;
  color: #fff;
  background: linear-gradient(145deg, #4b0b10, #151515);
  box-shadow: inset 0 1px #ffffff18, 0 12px 32px #0006;
}

.profile-avatar.compact { width: 42px; height: 42px; border-radius: 14px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar b { font-size: 30px; }
.profile-avatar.compact b { font-size: 16px; }

.avatar-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.avatar-editor > div:nth-child(2) > strong,
.avatar-editor > div:nth-child(2) > p { display: block; }
.avatar-editor > div:nth-child(2) > p { margin: 5px 0 12px; color: #999; font-size: 12px; line-height: 1.45; }
.avatar-error { display: block; margin-top: 8px; color: #ff7e85; }

.avatar-crop {
  grid-column: 1 / -1;
  border-top: 1px solid #ffffff17;
  padding-top: 18px;
}

.avatar-crop[hidden] { display: none; }
.avatar-crop > strong { display: block; margin-bottom: 12px; }
.avatar-crop-stage {
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #ffffff28;
  border-radius: 24px;
  margin-bottom: 14px;
  background: #080808;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage.dragging { cursor: grabbing; }
.avatar-crop-stage::after {
  position: absolute;
  inset: 9%;
  border: 1px solid #ffffff80;
  border-radius: 27%;
  box-shadow: 0 0 0 100vmax #0000004f;
  content: "";
  pointer-events: none;
}

.avatar-crop-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform-origin: center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.avatar-crop label { display: grid; max-width: 320px; gap: 7px; color: #999; font-size: 11px; }
.avatar-crop input[type="range"] { width: 100%; accent-color: #e50914; }
.avatar-crop > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 520px) {
  .avatar-editor { grid-template-columns: 72px minmax(0, 1fr); gap: 13px; }
  .profile-avatar.editor-preview { width: 72px; height: 72px; border-radius: 22px; }
}
